Re: [R] more woes trying to convert a data.frame to a numerical matrix

From: Marc Schwartz <marc_schwartz_at_comcast.net>
Date: Wed, 16 May 2007 10:45:00 -0500

On Wed, 2007-05-16 at 11:29 -0400, Liaw, Andy wrote:
> I think this might be a bit more straight forward:
>
> R> mat <- do.call(cbind, scan("clipboard", what=list(NULL, 0, 0, 0),
> sep=",", skip=2))
> Read 3 records
> R> mat
> [,1] [,2] [,3]
> [1,] 1 2 3
> [2,] 4 5 6
> [3,] 7 8 9
>
> Andy

<snip>

Good approach Andy and with a large source file should also be faster I would think.

Regards,

Marc



R-help_at_stat.math.ethz.ch 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. Received on Wed 16 May 2007 - 15:58:55 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 16 May 2007 - 16:31:07 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.