An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20131214/5f1c6f7d/attachment.pl>
converting a coloumn in a data set to a vector
3 messages · Patty Haaem, David Winsemius, arun
On Dec 14, 2013, at 6:34 AM, Patty Haaem wrote:
Hi every one, I have a simple question. I want to make a vector from one of the colomns in a data set. for example I have this data: x1 x2 x3 1 5 7 4 8 9 8 6 12 4 8 13 I want to convert x1 to a vector such as: x1= c(1,4,8,4) How I can do it?
?Extract
David Winsemius Alameda, CA, USA
Hi, Try: dat1 <- read.table(text="x1 x2 x3 ?1?? 5?? 7 ?4?? 8?? 9 ?8??? 6? 12 ?4?? 8?? 13",sep="",header=TRUE) ?vec1 <- dat1[,1] ?vec1 #[1] 1 4 8 4 A.K.
On Saturday, December 14, 2013 12:55 PM, Patty Haaem <elham_h763 at yahoo.com> wrote:
Hi every one, I have a simple question. I want to make a vector from one of? the colomns in a data set. for example I have this data: x1 x2 x3 1?? 5? ?7 4?? 8?? 9 8??? 6??12 4?? 8?? 13 ?I want to convert x1 to a vector such as: x1= c(1,4,8,4) How I can do it? Thanks ??? [[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.