An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20090303/64c9c3fe/attachment-0002.pl>
Characters To Matrix
3 messages · Bob Roberts, Dieter Menne, jim holtman
Bob Roberts <quagmire54321 <at> yahoo.com> writes:
I have a data set that I read in using readLines, but R classes it as a
character string. The data set has
multiple columns and rows, but I only want the first 2 columns in the form of
a matrix. Thanks for the help. data(CO2) str(CO2) col2 = as.matrix(CO2[,1:2]) str(col2) Dieter
Why aren't you using 'read.table'?
On Tue, Mar 3, 2009 at 3:47 AM, Bob Roberts <quagmire54321 at yahoo.com> wrote:
Hi, ? I have a data set that I read in using readLines, but R classes it as a character string. The data set has multiple columns and rows, but I only want the first 2 columns in the form of a matrix. Thanks for the help. ? ? ? ?[[alternative HTML version deleted]]
______________________________________________ R-help at 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.
Jim Holtman Cincinnati, OH +1 513 646 9390 What is the problem that you are trying to solve?