Skip to content
Prev 319163 / 398506 Next

list + lapply insead of matrix + apply

Hi, 
For the first case:
lst2<-lapply(x.list, calcnorm2, x.list)
?lapply(lst2,function(x) do.call("c",x))
#[[1]]
#[1]? 0.00000 31.75257

#[[2]]
#[1] 31.75257? 0.00000
A.K.



For the second case:
?lst1<-as.list(data.frame(t(apply(x,1,calcnorm2.const,x)))) 
?names(lst1)<- NULL 
?lst1 
#[[1]] 
#[1] ?0.00000 31.75257 

#[[2]] 
#[1] 31.75257 ?0.00000 




A.K.  
----- Original Message -----
From: ishi soichi <soichi777 at gmail.com>
To: r-help <r-help at r-project.org>
Cc: 
Sent: Sunday, March 10, 2013 1:18 AM
Subject: Re: [R] list + lapply insead of matrix + apply

there is a typo.

lapply(x.list, calcnorm, x.list)

should be

lapply(x.list, calcnorm2, x.list)

sorry.




2013/3/10 ishi soichi <soichi777 at gmail.com>
??? [[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.