[R] read.csv help
Peter Ehlers
ehlers at ucalgary.ca
Tue Jul 19 11:32:07 CEST 2011
On 2011-07-19 01:27, psombe wrote:
> Well yeah it works fine for small data but when i tried the exact same
> command with a large data set (abt 167 rows and 4000 columns) it gave me a
> different data frame.
> either i get the first column as row names and so when i put data[1,1] i
> get the the first row second column data (from the original data) as the
> first row became row names.
> or
> if i explicitly put row.names = NULL i get my columns shifted.
>
> this is how the data should look
>> tdata[1,1:3]
> timestamp system.system.nfs_ops system.system.cifs_ops
> 1 1299376803 1104233 0
>
>
> and this is how i'm able to load the data
>
> row.names timestamp system.system.nfs_ops system.system.cifs_ops
> 1 1299376803 1104233 0 0
>
> notice the shift in the first column
> i hope this makes my problem clearer
This has nothing to do with the size of your data set.
Try count.fields() on your data file and do take note of the
description of the row.names argument to read.csv function:
"If there is a header and the first row contains one fewer field than
the number of columns, the first column in the input is used for the
row names."
Peter Ehlers
>
> --
> View this message in context: http://r.789695.n4.nabble.com/read-csv-help-tp3677454p3677586.html
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list