plotHostSwitch: HostSwitch standard plot

View source: R/plots.R

plotHostSwitchR Documentation

HostSwitch standard plot

Description

This function creates a standard plot for the simulated host switches

Usage

plotHostSwitch(HostSwitch_simulated_quantities, sim_n = 1)

Arguments

HostSwitch_simulated_quantities

The object HostSwitch created by simHostSwitch()

sim_n

for HostSwitch object including more than 1 simulation saved, "sim_n" specifies which simulation have to be plotted. The plot from the first simulation is shown as default (sim_n = 1). If the called simulation number is not present in the HostSwitch object, an error message will be returned.

Details

The function plots dispersal and colonization (host-switching events) of Consumers on a novel host offered at each generation given the values of parameters related to carrying capacity, fitness space, migration, reproduction, selection, and biological model. The X-axis shows the total number of possible generations defined in the object HostSwitch, the Y-axis the phenotype values of the Consumer.

Black dots are the phenotype values of the Consumer after each event of reproduction. The green squares represent the value of phenotype favored by the novel Resource offered at each generation. The red squares are the phenotype values of the Consumer favored by the current Resource.The blue dots represents the phenotypes of dispersing Consumers, and the yellow dots the successfully colonizing Consumers.

Value

An S3 object with class gg/ggplot

Examples

m1 = simHostSwitch(n_sim=100) # create an HostSwitch object with 100 simulations.

## The results of the first simulation (sim_n=1) are plotted as default
plotHostSwitch(m1)

## The 50th simulation of the model is plotted
plotHostSwitch(m1,sim_n=50)


HostSwitch documentation built on March 7, 2023, 8:26 p.m.