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

Description Usage Arguments Value References See Also Examples

View source: R/simulate.transectHolder.R

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

1
2
3
## S3 method for class transectHolder 
## S3 method for class '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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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)

spuRs documentation built on May 2, 2019, 12:44 p.m.