Skip to content
Back to formatted view

Raw Message

Message-ID: <1387045233.81502.YahooMailNeo@web142601.mail.bf1.yahoo.com>
Date: 2013-12-14T18:20:33Z
From: arun
Subject: converting a coloumn in a data set to a vector
In-Reply-To: <1387031667.79756.YahooMailNeo@web141102.mail.bf1.yahoo.com>

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.