(lapply(Caso,names)))
vec1<- numeric(length(nm))
names(vec1)<- nm
do.call(rbind,lapply(Caso,function(x){ indx<- names(vec1)%in% names(x);
vec1[indx]<-x;vec1 }))
# 0 1 2
#9 2 10 0
#13 2 0 4
A.K.
- Original Message -
From: Sebastian Kruk
To: R-help
Cc:
Sent: Thursday, Septe
On Thu, Sep 26, 2013 at 2:02 PM, Sebastian Kruk wrote:
> I have a list that gives me the number of occurrences of numbers 1, 2, 3 and
> 4.
>
>
> Sometimes a single in a casa just appears 0 and 1, in others only 2, and every
> combination you can think of.
>
>
> Eg
>
>
>> Caso [1:2]
> $ `9`
>
>
>
I have a list that gives me the number of occurrences of numbers 1, 2, 3 and
4.
Sometimes a single in a casa just appears 0 and 1, in others only 2, and every
combination you can think of.
Eg
> Caso [1:2]
$ `9`
0 1
2 10
$ `13`
0 2
2 4
Can I turn it into a matrix consisting of 4 colum
3 matches
Mail list logo