Skip to content
Prev 316721 / 398506 Next

create and save a simulated dataset

Hello,

Once you formulate the problem properly, it's not hard to solve it in R.

Bert's questions should be answered before continuing. I'll make two 
assumptions, not present in your post.
All diameters are assumed independent and to follow the same uniform 
distribution. (iid scenario; the two assumptions you have to decide about.)

With these in mind, you can get some inspiration from the following 
code. It produces 10 vectors of a random numbers of trees of random 
diameters.


min.diam <- 1  # trees' diameters
max.diam <- 2  #
max.trees <- 10  # trees per stand
lapply(1:10, function(i) runif(sample(max.trees, 1), min.diam, max.diam))


Hope this helps,

Rui Barradas

Em 02-02-2013 20:10, Giovanna Ottaviani escreveu: