[R] Reading in a tab delimitated file
amindlessbrain
jillianrowe91286 at gmail.com
Tue Oct 26 14:35:01 CEST 2010
Hi all,
I have a total newbie question, but I could really use some help.
I need to read in this file:
SampleID Disease
E-CBIL-28-raw-cel-1435145228.cel 1
E-CBIL-28-raw-cel-1435145451.cel 2
E-CBIL-28-raw-cel-1435145479.cel 2
E-CBIL-28-raw-cel-1435145132.cel 3
E-CBIL-28-raw-cel-1435145417.cel 3
E-CBIL-28-raw-cel-1435145301.cel 2
E-CBIL-28-raw-cel-1435145558.cel 1
E-CBIL-28-raw-cel-1435145073.cel 3
E-CBIL-28-raw-cel-1435145196.cel 2
E-CBIL-28-raw-cel-1435145511.cel 1
E-CBIL-28-raw-cel-1435145336.cel 3
E-CBIL-28-raw-cel-1435145260.cel 2
E-CBIL-28-raw-cel-1435145167.cel 2
E-CBIL-28-raw-cel-1435145387.cel 3
E-CBIL-28-raw-cel-1435145099.cel 3
(I'm not sure why the disease column isn't showing up as a tab here, but it
is sep by "\t" in my file.
I've tried several variations on these:
pd <- read.AnnotatedDataFrame ("new_treat.txt" , header = TRUE , sep="\t",
row.names = "SampleID", colClasses = c(Disease = "character"))
And I keep on getting this error:
Error in read.table(filename, sep = sep, header = header, quote = quote, :
more columns than column names
Any help would be very very very appreciated!
Thanks!
--
View this message in context: http://r.789695.n4.nabble.com/Reading-in-a-tab-delimitated-file-tp3013620p3013620.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list