I need to obtain all the results from each step of a for loop, instead of getting just `NA` and final number out of 91 vectors.

```r
m<-log((189^2)/(sqrt(189^2+127^2)))         
s<-sqrt(log((189^2+127^2)/189^2)) 
logPtr<- c(-2.24,-2.36,-2.37,-2.58,-2.82,-2.86,-3.16,-3.17,-3.47,-3.52,-3.57,-3.83,
        -3.83,-3.84,-3.87,-3.89,-3.89,-3.90,-3.94,-4.03,-4.09,-4.42,-4.53,-4.54,-4.54,
        -4.62,-4.62,-4.68,-4.73,-4.76,-4.84,-4.92,-4.93,-4.95,-4.97,-5.20,-5.25,-5.27,
        -5.39,-5.47,-5.60,-5.83,-5.89,-5.95,-5.96,-6.02,-6.23,-6.38,-6.96,-7.37,-7.90, 
        -8.20,-9.00,-9.00,-9.00)

# transfer rate from meat to portion to eat#  
#55 
#transfer values (observational study)#lambda = Eq.1 outputs * values of 
#conc.meat          
Ptr<-10^logPtr         

p_Ptr<-c(1/55, 1/55, 1/55, 1/55, 1/55, 1/55, 1/55, 1/55, 1/55, 1/55, 
       1/55, 1/55, 1/55, 1/55, 1/55, 1/55, 1/55, 1/55, 1/55, 1/55, 1/55, 
       1/55, 1/55, 1/55, 1/55, 1/55, 1/55, 1/55, 1/55, 1/55, 1/55, 1/55, 
       1/55, 1/55, 1/55, 1/55, 1/55, 1/55, 1/55, 1/55, 1/55, 1/55, 1/55, 
       1/55, 1/55, 
       1/55, 1/55, 1/55, 1/55, 1/55, 1/55, 1/55, 1/55, 1/55, 1/55)         

alpha<-0.145        

beta<-7.59           

v<-c(10^(seq(-2, 7, by=0.1)))    

set.seed(123)   
library(mc2d)    

result <- data.frame(matrix(nrow = 91, ncol = 2))    
colnames(result) <- c("cm", "Mean_Pill")    

for (cm in v)#looping for each value of cm    
     {     
     ndvar(50001)      
     Wc<-mcstoc(rlnorm,meanlog=m,sdlog=s)      
     Nportion<-mcstoc(rpois,lambda=((Wc)*(cm)))      
     P_trans<-mcstoc(rempiricalD, values=c(Ptr), prob=c(p_Ptr))     
     d<-mcstoc(rbinom, size=Nportion, prob=P_trans)     
     Pill<-0.33*(1-((1+d/beta)^(-alpha)))     
     mean_Pill<-mean(Pill, na.rm = TRUE)    
     result[i, 1] <- cm    
     result[i, 2] <- mean(Pill, na.rm = TRUE)    
     }     

print(result)            

```