Hi!
 
I want to print the output all together with a single column name 
 
s21<-c(1:1000);
var21<-lapply(s21,function(x){
   ns<-rnorm(78,8,9);
   n<-length(ns);
   Mn<-mean(ns) 
   Sn2<-var(ns)
   return(cbind(x,Mn,Sn2));
});
var21

but my code is giving me somewhat like the following
[[1]] x   Mn          Sn2
  [1,] 1 7.86 10.56540

[[2]] x   Mn          Sn2
  [1,] 2 8.11 7.685347

I want to print the mean and variance as 
x   Mn          Sn2 
1 7.86 10.56540
2 8.11 7.685347

Thanks in advance.

Shaan


      
        [[alternative HTML version deleted]]

______________________________________________
R-help@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.

Reply via email to