Togaware DATA MINING
Desktop Survival Guide
by Graham Williams
Google

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))]



Copyright © Togaware Pty Ltd
Support further development through the purchase of the PDF version of the book.
The PDF version is a formatted comprehensive draft book (with over 800 pages).
Brought to you by Togaware. This page generated: Sunday, 22 August 2010