Displaying 1 result from an estimated 1 matches for "makenacon".
2005 Jul 05
1
help eliminating for loops
...e the for loops?
R 2.1.1 patched
Windows 2k
Thanks,
John
function ()
{
NaCon<-array(dim=c(10,10))
for (i in 1:10) {NaCon[i,]<-rnorm(10,10.77,0.02)}
MeanNaCon<-vector(mode="numeric",length=10)
for (j in 1:10) {MeanNaCon[j]<-mean(NaCon[j,1:10])}
print(MeanNaCon)
#assign("MakeNaCon",MakeNaCon)
hist(MeanNaCon)
}
John Sorkin M.D., Ph.D.
Chief, Biostatistics and Informatics
Baltimore VA Medical Center GRECC and
University of Maryland School of Medicine Claude Pepper OAIC
University of Maryland School of Medicine
Division of Gerontology
Baltimore VA Medical Center
10 Nor...