### R code from vignette source 'range_expansion-knitr.Rnw' ################################################### ### code chunk number 1: range_expansion-knitr.Rnw:29-46 (eval = FALSE) ################################################### ## library(MetaLandSim) ## ## #Load starting landscape (the simulation will assume that ## #all subsequent landscapes are built with the same parameter ## #combination). ## ## data(rland) ## ## #Create range expansion model. Here run only with two repetitions ## #(iter=2). ## #Ideally it should be run with more repetitions to provide more ## #robust results. ## ## data(param1) ## ## rg_exp1 <- range_expansion(rl=rland, percI=50, param=param1,b=1, ## tsteps=100, iter=2) ################################################### ### code chunk number 2: range_expansion-knitr.Rnw:55-69 (eval = FALSE) ################################################### ## data(rg_exp) ## presences <- paste(system.file(package="MetaLandSim"), ## "/examples/presences.asc", sep="") ## landmask <- paste(system.file(package="MetaLandSim"), ## "/examples/landmask.asc", sep="") ## ## #Create raster, using the sample dataset ## #rg_exp (generated with 100 repetitions) ## ## #we can load the pre-defined dataset: ## data("rg_exp") ## ## range_raster(presences.map = presences, re.out=rg_exp, ## mask.map=landmask, plot.directions=FALSE)