plot_ranges: Plot species ranges of the given list of species on a...

Description Usage Arguments Examples

View source: R/plotting_functions.R

Description

Plot species ranges of the given list of species on a landscape

Usage

1
plot_ranges(species_list, landscape, disturb = 0, max_sps = 10)

Arguments

species_list

a list of species to use in the richness calculation

landscape

a corresponding landscape object

disturb

value randomly added to shift each species symbol. Useful to enhance visualization in case of multiple species overlaps

max_sps

maximum number of plotted species, not recommended above 20

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
## plot from saved outputs
# get path containing outputs
datapath <- system.file(file.path("extdata", "WorldCenter"), package="gen3sis")
# get species at t0
species_t_50 <- readRDS(file.path(datapath,
                        "output/config_worldcenter/species/species_t_50.rds"))
# get landscape at t0
landscape_t_50 <- readRDS(file.path(datapath,
                          "output/config_worldcenter/landscapes/landscape_t_50.rds"))
# plot range
plot_ranges(species_t_50, landscape_t_50)

# get species at t0
species_t_25 <- readRDS(file.path(datapath, 
                        "output/config_worldcenter/species/species_t_25.rds"))
# get landscape at t0
landscape_t_25 <- readRDS(file.path(datapath, 
                        "output/config_worldcenter/landscapes/landscape_t_25.rds"))
# plot ranges at intermediate time-step
plot_ranges(species_t_25, landscape_t_25, disturb = 2, max_sps = 20)

## plot from within observer
# call plot_richness from inside the end_of_timestep_observer function 
# at the config file:
## Not run: 
plot_ranges(data$all_species, data$landscape)

## End(Not run) 

ZHG2017/Rcpp-packageGen3sis documentation built on Dec. 18, 2021, 8:24 p.m.