Learn R Programming

MetaLandSim (version 0.2)

manage_landscape_sim: Batch landscape simulation

Description

Runs a series of simulations, using iterate.graph, allows changing the simulations parameters in several sequential simulations.

Usage

manage_landscape_sim(par_df, parameters_spom)

Arguments

par_df
Arguments data frame to be used by iterate.graph (each row of this data frame is a set of Arguments). The data frame has to have the following columns in this order (the name of the column is not relevant):
  • A_MIN - Minimum patch area for persisten
parameters_spom
Parameters data frame, as given by parameter.estimate.

Value

  • Returns a data frame with the parameters used for the simulations and the results (mean occupation, mean number of patches, mean turnover, mean distance and mean area).

Details

For details regarding the arguments see the respective functions.

See Also

rland.graph, span.graph, species.graph, spom

Examples

Run this code
#Setup the parameters for each simulation:
PAR1_SPAN2 <- rep('ncsd',820)#parameter 1 for the span function 
PAR2_SPAN2 <- rep(seq(from=0,to=80,by=2), each=20)#parameter 2 for the span function 
PAR3_SPAN2 <- rep(seq(from=0,to=80,by=2),20)#parameter 3 for the span function 
PAR4_SPAN2 <- rep(2,820)#parameter 4 for the span function 
PAR5_SPAN2 <- rep(2,820)#parameter 5 for the span function 
A_MIN_SPECIES2 <- rep(0,820)#minimum area to be considered occupied 
NSEW_SPECIES2 <- rep('none',820)#where to start populating the landscape 
PARM_SPECIES2 <- rep(5,820)#parameter for the species function 
METHOD_SPECIES2 <- rep('percentage',820)#method for populating the landscape 
MAPSIZE2 <- rep(10000,820)#dimension of the landscape 
SPAN2 <- rep(100,820)#number of time steps of each simulation 
ITER2 <- rep(5,820)#number of iterations of each simulation 
NPATCH2 <- rep(800,820)#number of patches 
AREA_M2 <- rep(0.45,820)#mean area 
AREA_SD2 <- rep(1,820)#area sd 
MDST2 <- rep(0,820)#minimum distance between 
KERN <- rep('op1',820)#kernel
CONN <- rep('op1',820)#connectivity function 
COLNZ <- rep('op1',820)#colonization function 
EXT <- rep('op1',820)#extinction function 
BETA1 <- rep('NULL',820) 
B <- rep(1,820) 
C1 <- rep('NULL',820) 
C2 <- rep('NULL',820) 
Z <- rep('NULL',820) 
R2 <- rep('NULL',820) 
DISPERSAL2 <- rep(800,820)#mean dispersal ability of the species 


#Build parameter data frame (keep the order of the parameters):
simulation <- data.frame(A_MIN_SPECIES2,MDST2,NPATCH2,AREA_M2,AREA_SD2,
MAPSIZE2,SPAN2,ITER2,PAR1_SPAN2,PAR2_SPAN2,PAR3_SPAN2,PAR4_SPAN2,PAR5_SPAN2,
NSEW_SPECIES2,PARM_SPECIES2,METHOD_SPECIES2,KERN,CONN,COLNZ,EXT,BETA1,B,C1,C2,Z,R2,
DISPERSAL2)


#Delete vectors used for data frame creation:
rm('PAR1_SPAN2','PAR2_SPAN2','PAR3_SPAN2','PAR4_SPAN2','PAR5_SPAN2','A_MIN_SPECIES2',
'NSEW_SPECIES2','PARM_SPECIES2','METHOD_SPECIES2','MAPSIZE2','SPAN2','ITER2',
'NPATCH2','AREA_M2','AREA_SD2','MDST2','KERN','CONN','COLNZ','EXT',
'BETA1','B','C1','C2','Z','R2','DISPERSAL2')


data(param1)

ms2 <- manage_landscape_sim(par_df=simulation,parameters_spom=param1)

Run the code above in your browser using DataLab