Learn R Programming

SEHmodel (version 0.0.11)

loadIndividuals: Wrapper function loadIndividuals

Description

Wrapper function to create an Individuals object using SpatialPoints and dataframe.

The SpatialPoints object and the data.frame have to contain the same number of coordinates and rows.

Usage

loadIndividuals(objectL, sp, data, mintime, maxtime)

Arguments

objectL
a Landscape object
sp
a SpatialPoint object (individuals coordinates)
data
a data.frame containing individuals attributes. Rows numbers as individuals ID, columns names as dob (date of birth) | life_duration | toxic_threshold
mintime
Start simulation time
maxtime
End simulation time

Value

an Individuals-class object

Examples

Run this code
 
## Not run: 
# # simulate individuals coordinates (SpatialPoints object):
# coordinates <- spsample(getSPReceptors(land),n=2)
# df <- data.frame("dob"=c(1,8),"life_duration"=c(20,20),
#            "toxic_threshold"=c(15,15),row.names = c(1,2))
# ind <- loadIndividuals(objetL=land,sp=coordinates,data=df,mintime=1,maxtime=60)
# ## End(Not run)

Run the code above in your browser using DataLab