LoslegenKostenlos loslegen

Dealing with empty and incomplete lines

When reading irregular files, i.e., files with varying/missing fields in rows, fread() tries to parse them intelligently. However, it may not be always possible to guess if the irregular lines should be skipped or imported by filling missing fields. For such cases, you can use the fill argument of fread().

You will be importing the following file:

id,name,val
9002019291929192,Robert Whitaker,
9200129401349301 ,Elisa Waters,190  
9200149429834456 , Karla Schmidt  

Notice that the first and last lines are incomplete.

Diese Übung ist Teil des Kurses

Data Manipulation with data.table in R

Kurs anzeigen

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

# Import the file and note the warning message
incorrect <- ___
incorrect
Code bearbeiten und ausführen