Re: [Rd] suggestion for read.table

2007-09-20 Thread Benjamin Tyner
Correction: the warning would be triggered by warning("cols = ", cols, " != length(data) = ", length(data), domain = NA) Ben On 9/20/07, Benjamin Tyner <[EMAIL PROTECTED]> wrote: > R-devel, > > IMHO, in readtable.R, the scan command > > > if (nlines > 1) > for (i in seq_along(col)) >

[Rd] suggestion for read.table

2007-09-20 Thread Benjamin Tyner
R-devel, IMHO, in readtable.R, the scan command if (nlines > 1) for (i in seq_along(col)) col[i] <- length(scan(file, what = "", sep = sep, quote = quote, nlines = 1, quiet = TRUE, skip = 0,

Re: [Rd] Suggestion for read.table()

2006-08-31 Thread Prof Brian Ripley
On Thu, 31 Aug 2006, Simon Urbanek wrote: > > On Aug 30, 2006, at 10:15 PM, Prof Brian Ripley wrote: > > >On Wed, 30 Aug 2006, [EMAIL PROTECTED] wrote: > > > > >However, direct reading might be a good option? > > > >See ?textConnection for how to do this. > > > >inp <- " x y z > >1 2

Re: [Rd] Suggestion for read.table()

2006-08-30 Thread Wolfgang Huber
Hi Giles, x = "x y z\n1 2 3\n4 5 6" res = read.table(textConnection(x), header=TRUE) will do. See also http://cran.r-project.org/doc/manuals/R-data.html Best wishes Wolfgang Huber EMBL-EBI, Cambridge UK [EMAIL PROTECTED] wrote: > First, I compliment you all > for such a useful project a

Re: [Rd] Suggestion for read.table()

2006-08-30 Thread Gabor Grothendieck
Try this: > raw= + " x y z + 1 2 3 + 4 5 6 + " > read.table(textConnection(raw), header = TRUE) x y z 1 1 2 3 2 4 5 6 On 8/30/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > First, I compliment you all > for such a useful project as R. > > Suggestion: If read.table() could >

Re: [Rd] Suggestion for read.table()

2006-08-30 Thread Prof Brian Ripley
On Wed, 30 Aug 2006, [EMAIL PROTECTED] wrote: > First, I compliment you all > for such a useful project as R. > > Suggestion: If read.table() could > take input from a character string, > then one could write > > raw= > " x y z >1 2 3 >4 5 6 > " > df = read.table(raw,head=TRUE

[Rd] Suggestion for read.table()

2006-08-30 Thread gilescrane
First, I compliment you all for such a useful project as R. Suggestion: If read.table() could take input from a character string, then one could write raw= " x y z 1 2 3 4 5 6 " df = read.table(raw,head=TRUE) Of course, one can cat() to write raw into a temporary file, and read