[R] question

2015-04-13 Thread Mahdiyeh Erfaniyan
Hi all, Recently I sent an email and I was asked to provide reproducible code of a simple example of my situation. Instead of providing the code, I decided to describe what I need in my code. I've written a function V, which is a function of (r,s); so I have a function V(r,s) in fact. The output

[R] How to complete this code

2015-04-10 Thread Mahdiyeh Erfaniyan
Hi, Consider the line below: for(r in a)for (s in a) x=rbind(x,apply(replicate(1000,V(r,s)),1,mean)) V is a vector of (n-1) variables calculated by some rule and is a functions of (r,s). So the line above produces 1000 replicates of V for each (r,s), puts them in a matrix, calculates the