DATA MINING
Desktop Survival Guide by Graham Williams |
|||||
Reading Variable Width Data |
Suppose we have a csv file containing:
1,2,3,4, 2,3,4,5,0,0 3,4,5,6,0,0,0 |
We can read this, keeping only the 4 columns with data, treating the 0 as nulls:
my.df <- read.table("incomplete.csv", sep=",", fill=TRUE, na.strings=0) df complete.cases(t(my.df)) my.df[, complete.cases(t(my.df))] |