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.

Reply via email to