plot_net.BipartiteEvol: Plot the output of BipartiteEvol

View source: R/plot_BipartiteEvol.R

plot_net.BipartiteEvolR Documentation

Plot the output of BipartiteEvol

Description

Plot the genealogies, phylogenies and interaction network simulated with BipartiteEvol

Usage

plot_net.BipartiteEvol(gen, spec, trait.id, link, 
    out, lwdgen = 1, lwdsp = lwdgen, scale = NULL, 
    nx = NULL, cor = F, network.method = "bipartite", 
    spatial = F)

Arguments

gen

The output of a run of make_gen.BipartiteEvol

spec

The output of a run of define_species.BipartiteEvol

trait.id

The trait dimension used to color the genealogies, phylogenies an network with trait values

out

The output of a run of sim.BipartiteEvol

link

The output of a run of sim.BipartiteEvol

lwdgen

Width of the branches of the genealogies, default to 1

lwdsp

Width of the branches of the phylogenies, default to 1

scale

Optional, used to force the trait scale

nx

Grid size parameter used in sim.BipartiteEvol. If NULL, squrt(N) is used, where N is the number of individuals in a guild

cor

If F (the default), the middle panel displays the interraction network with species positionned in trait space. If T, it shows all the individual in trait space

network.method

How should the network be plotted? Can be "bipartite" (the default) or "matrix"

spatial

Should the grid with trait values of the individual of both guilds been shown? Default to F

Details

The upper line shows the genealogies colored with trait values for both guilds (the number above shows the depth of the respective genealogy).

The second line shows the phylogenies colored with trait values for both guilds (the number above shows the tip number of the respective phylogeny).

On the third line there is, from left to right, the trait distribution within individuals in guild P (for the dimension trait.id), the interraction network with species positionned in trait space (if cor = T), and the trait distribution within individuals in guild H (for the dimension trait.id).

The lower line shows the quantitative interaction network, with species colored according to their mean trait value (for the dimension trait.id).

Author(s)

O. Maliet

References

Maliet, O., Loeuille, N. and Morlon, H. (2020), An individual-based model for the eco-evolutionary emergence of bipartite interaction networks. Ecol Lett. doi:10.1111/ele.13592

See Also

sim.BipartiteEvol

Examples

# run the model
set.seed(1)


if(test){
mod = sim.BipartiteEvol(nx = 8,ny = 4,NG = 1000,
                        D = 3, muP = 0.1 , muH = 0.1,
                        alphaP = 0.12,alphaH = 0.12,
                        rP = 10, rH = 10,
                        verbose = 100, thin = 5)

#build the genealogies
gen = make_gen.BipartiteEvol(mod)
plot(gen$H)

#compute the phylogenies
phy1 = define_species.BipartiteEvol(gen,threshold=1)

#build the network
net = build_network.BipartiteEvol(gen, phy1)

trait.id = 1
plot_net.BipartiteEvol(gen,phy1,trait.id, net,mod, nx = 10, spatial = FALSE)
}

hmorlon/PANDA documentation built on April 24, 2024, 3:27 a.m.