Learn R Programming

spuRs (version 2.0.2)

simulate.transectHolder: Function to simulate a modelled seed rain from a transectHolder

Description

This function simulates a two-dimensional seed rain according to the model stored in a transectHolder object. The angle of the seed location from the parent plant is uniformly distributed on [0, 2 pi).

Usage

## S3 method for class transectHolder 
# S3 method for transectHolder
simulate(object, nsim=1, seed=NULL, …)

Arguments

object

the transectHolder object for simulation

nsim

the number of seeds to simulate.

seed

if not NULL, set the seed to this value before simulation.

additional optional arguments (ignored here).

Value

A dataframe with n rows with the following components:

distances

seed distances to parent plant

angles

seed angles to parent plant, in radians

x

x-location of seed

y

y-location of seed

References

Jones, O.D., R. Maillardet, and A.P. Robinson. 2009. An Introduction to Scientific Programming and Simulation, Using R. Chapman And Hall/CRC.

See Also

transectHolder

Examples

Run this code
# NOT RUN {
transect.1 <- trapTransect(distances = 1:4,
                        seed.counts = c(4, 3, 2, 0))
transect.2 <- trapTransect(distances = 1:3,
                        seed.counts = c(3, 2, 1))
transect.3 <- trapTransect(distances=(1:5)/2,
                        seed.counts = c(3, 4, 2, 3, 1))
allTraps <- transectHolder(transect.1, transect.2, transect.3,
                           family="Weibull")
allTraps
simulate(allTraps, nsim=5, seed=123)
# }

Run the code above in your browser using DataLab