Try unique and paste.
paste(unique(tes)[,1], unique(tes)[,2], sep = "")
-
A R learner.
--
View this message in context:
http://r.789695.n4.nabble.com/two-columns-into-one-tp2242516p2242658.html
Sent from the R help mailing list archive at Nabble.com.
__
Hi there,
May be expand.grid() ?
HTH,
Jorge
On Thu, Jun 3, 2010 at 5:55 PM, moleps <> wrote:
> Dear R´ers,
>
>
> How can I create one single factor variable from two variables
> incorporating all possible combinations of the values??
>
>
> test<-sample(c("A",NA,"B"),100,replace=T)
> test2<-sam
Dear R´ers,
How can I create one single factor variable from two variables incorporating
all possible combinations of the values??
test<-sample(c("A",NA,"B"),100,replace=T)
test2<-sample(c("E",F,"A"),100,replace=T)
tes<-cbind(test,test2)
pseduocode:
r<-function(test,test2)
r
AE
AF
AA
NA
3 matches
Mail list logo