Skip to content
Back to formatted view

Raw Message

Message-ID: <4EE1204A.9000209@gmail.com>
Date: 2011-12-08T20:38:34Z
From: Duncan Murdoch
Subject: read.table question
In-Reply-To: <CAEH-2W1a_3T4y_fveBq5Gpwbf6zJT_B18w1NL-U6HH3Laa8m2Q@mail.gmail.com>

On 08/12/2011 3:28 PM, Pavan G wrote:
> Hello All,
> This works,
> results<- read.table("plink.txt",T)
>
> while this doesn't.
> results<- read.table("plink.txt")
>    Make sure your data frame contains columns CHR, BP, and P
>
> What does adding the "T" in read.table do? Which argument does this
> correspond to? I tried searching for it but didn't find the answer in:
>
>
>       read.table(file, header = FALSE, sep = "", quote = "\"'",
>                  dec = ".", row.names, col.names,
>                  as.is = !stringsAsFactors,
>                  na.strings = "NA", colClasses = NA, nrows = -1,
>                  skip = 0, check.names = TRUE, fill = !blank.lines.skip,
>                  strip.white = FALSE, blank.lines.skip = TRUE,
>                  comment.char = "#",
>                  allowEscapes = FALSE, flush = FALSE,
>                  stringsAsFactors = default.stringsAsFactors(),
>                  fileEncoding = "", encoding = "unknown")
>
>
> Could someone please explain?

You didn't name your arguments, so positional matching is used.  Your 
call is equivalent to

read.table(file = "plink.txt", header = T)

In most users' sessions, that's the same as

read.table(file = "plink.txt", header = TRUE)

and I'd guess that's true about yours.


Duncan Murdoch