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))
>
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,
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
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
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
>
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
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