In: Computer Science
Please provide an example of how MC.sim in R is to be used. The data can be made up, but please provide steps and explanations what to plug into that function. Thanks.
Metacommunity Simulation package (MC.sim) , written in ANSI -Standard C language.
--> In order to install the current version of MCsim, u need to have devtools installed.
Once devtools is installed. u can install the current version of
MCsim.
there are two steps to create metacommunity simulation in MC.sim:,
1. Make a "Landscape" :
The landscape in the "game board" on which the
simulation play out and is created using the
function. a landscape can be made from
, for
example:
xy.coordinates.<- data.frame (
x = c (1, 2,3,4,5,),
y -= c(1 ,3, 1,5,2 ))
print(xy.coordinates)
in addition for plotting use function: plot (y ~ x , xy.coordinates)
Vectors can also be passed to fm.make.landscape, for example:
my.landscape <- MCSim: :fn.make.landscape(
site.coords=xy.coordinates,
m= c(0.5,0.5,0.1,0.1,0.1),
Ef = c(-1, -.25, .1, 1 ,2) ,
JM=1000000)
print(my.landscape$site.info).
2. Run the Simulation:
once the landscape is created , you can pass the landscape object to fn.metaSIM, along with parameter settings.
To run the simulation we have to define:
1.) the players and the traits,
2) How the players move along sites,
3) what is the probability of new players appering?
4) How long is the game ,
5) saving the output,
print(sim.result$sim.result.name).