How about this:
t2 <- table(c(10,11,12,13))
t1 <-table(c(1,1,2,4,5))
t12<-(rbind(as.data.frame(t1),as.data.frame(t2)))
xtabs(Freq~.,t12)
it works for "overlapping" tables
t2 <- table(c(10,11,12,13,1,2))
t1 <-table(c(1,1,2,4,5,11,12))
t12<-(rbind(as.data.frame(t1),as.data.frame(t2)))
xtabs(Freq~.,
HI,
May be this helps:
t2 <- table(c(10,11,12,13))
t1 <-table(c(1,1,2,4,5))
t <- c(t1,t2)
tapply(t,sort(as.numeric(names(t))),sum)
A.K.
On Monday, December 9, 2013 7:01 PM, Ross Boylan wrote:
Can anyone recommend a good way to add tables?
Ideally I would like
t1 <- table(x1)
t2 <- table(x2)
On Mon, 2013-12-09 at 16:09 -0800, Ross Boylan wrote:
> Answering myself...
> On Mon, 2013-12-09 at 15:59 -0800, Ross Boylan wrote:
> > Can anyone recommend a good way to add tables?
> For count data, which were my main concern, it looks as if tabulate with
> nbins will work. I'm not sure how this
On Dec 9, 2013, at 3:59 PM, Ross Boylan wrote:
> Can anyone recommend a good way to add tables?
> Ideally I would like
> t1 <- table(x1)
> t2 <- table(x2)
> t1+t2
>
> It t1 and t2 have the same levels this works fine, but I need something
> that will work even if they differ, e.g.,
>> t1
>
> 1
On Mon, 2013-12-09 at 16:20 -0800, Roy Mendelssohn wrote:
> Is this what you are after?
>
> http://www.statmethods.net/management/merging.html
Not directly. Something could probably be fashioned using it and
as.data.frame on the result of table(), but merge doesn't sum values.
Ross
>
> -Roy
> O
Is this what you are after?
http://www.statmethods.net/management/merging.html
-Roy
On Dec 9, 2013, at 4:09 PM, Ross Boylan wrote:
> Answering myself...
> On Mon, 2013-12-09 at 15:59 -0800, Ross Boylan wrote:
>> Can anyone recommend a good way to add tables?
> For count data, which were my main
Answering myself...
On Mon, 2013-12-09 at 15:59 -0800, Ross Boylan wrote:
> Can anyone recommend a good way to add tables?
For count data, which were my main concern, it looks as if tabulate with
nbins will work. I'm not sure how this works with a cross-classifying
factor, which I will also need.
Can anyone recommend a good way to add tables?
Ideally I would like
t1 <- table(x1)
t2 <- table(x2)
t1+t2
It t1 and t2 have the same levels this works fine, but I need something
that will work even if they differ, e.g.,
> t1
1 2 4 5
2 1 1 1
> t2 <- table(c(10, 11, 12, 13))
> t1+t2 # apparen
8 matches
Mail list logo