Dear All,
I am trying to bootstrap a large data matrix 'exp' of dimension
9275x898 using package 'boot'. I am trying to calculate correlation of
the obtained samples. I have done following so far:

>library(boot)
>load("ratio_exp.RData") #loading the data matrix
>dim(ratio_exp)
[1] 9275  898
>sample.cor=function(ratio_exp,d){return(cor(t(ratio_exp[d,])))} #function for 
>obtaing correlation
>boot.exp=boot(ratio_exp,sample.cor,R=50)
Error in matrix(NA, sum(R), lt0) : too many elements specified

But when I reduced the no of replication that is 10 then I got following
>boot.exp=boot(ratio_exp,sample.cor,R=10)
> str(boot.exp$t)
 num [1:5, 1:86025625] 1 1 1 1 1 ...

In both the cases its not correct. So I am doing something wrong in
writing the function sample.cor. Please help!

regards
Amit

______________________________________________
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