Displaying 1 result from an estimated 1 matches for "combinedt".
Did you mean:
combined
2013 May 01
1
Combine multiple tables into one
...,
May be this helps:
dat1<- as.data.frame(table1)
?dat2<- as.data.frame(table2)
names(dat2)<-c("V3","V4")
library(plyr)
res<-join(dat1,dat2,type="full")
?res[is.na(res)]<- 0
?res
#? V1 V2 V3 V4
#1? 1? 1? 0? 0
#2? 1? 2? 0? 0
#3? 0? 0? 0? 1
#4? 0? 0? 0? 4
?combinedtable<-as.matrix(res)
?colnames(combinedtable)<- NULL
?combinedtable
#???? [,1] [,2] [,3] [,4]
#[1,]??? 1??? 1??? 0??? 0
#[2,]??? 1??? 2??? 0??? 0
#[3,]??? 0??? 0??? 0??? 1
#[4,]??? 0??? 0??? 0??? 4
A.K.
>Hi,
>
?>I am trying to combine multiple tables into one, where the
elements...