Right, I forgot to mention to use header = T. -------------------------------------- Jonathan P. Daily Technician - USGS Leetown Science Center 11649 Leetown Road Kearneysville WV, 25430 (304) 724-4480 "Is the room still a room when its empty? Does the room, the thing itself have purpose? Or do we, what's the word... imbue it." - Jubal Early, Firefly
From: Henrique Dallazuanna <www...@gmail.com> To: amindlessbrain <jillianrowe91...@gmail.com> Cc: r-help@r-project.org Date: 10/26/2010 11:08 AM Subject: Re: [R] Reading in a tab delimitated file Sent by: r-help-boun...@r-project.org Try this: Lines <- "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" DF <- read.table(textConnection(Lines), header = TRUE) On Tue, Oct 26, 2010 at 10:35 AM, amindlessbrain <jillianrowe91...@gmail.com > wrote: > > 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. > > ______________________________________________ > R-help@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. > -- Henrique Dallazuanna Curitiba-Paraná-Brasil 25° 25' 40" S 49° 16' 22" O [[alternative HTML version deleted]] ______________________________________________ R-help@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. [[alternative HTML version deleted]]
______________________________________________ R-help@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.