add.polygons: Plot the Distributions for the Phylogenetic Tips in 3D

Description Usage Arguments Details Author(s) References See Also Examples

View source: R/rase_source.r

Description

Plots the polygon surfaces of the tips of the phylogeny. It is mapped in 3D space, where the x/y axes are longitude/latitude, and the z axis is time. Although it works by itself, the polygons are intended to overlay an existing phylo.3d plot (see example).

Usage

1
add.polygons(df3, axes = 2, ...)

Arguments

df3

an object from data.for.3d.

axes

number of axes to be plotted (1 = 'x', 2 = 'x' & 'y', 3 = 'x', 'y' & 'z').

...

further arguments to be passed to polygon3d.

Details

The polygons do not have to be non-overlapping, however, when they do, they “flicker”.

Author(s)

Petr Keil

References

Quintero, I., Keil, P., Jetz, W., Crawford, F. W. 2015 Historical Biogeography Using Species Geographical Ranges. Systematic Biology. doi: 10.1093/sysbio/syv057

See Also

data.for.3d, phylo.3d, add.dens

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
  # load the mcmc results from rase run, polygons and tree
  data(rase_data, package = 'rase')

  pnames <- c('dextralis', 'viridis', 'leucoptera', 'interjecta', 
  'obscura', 'crepitans', 'ochroptera', 'napensis')
  psophia_poly <- name.poly(psophia_poly, psophia_tree, poly.names = pnames)

  # transform the data for 3d plotting
  df3 <- data.for.3d(mcmc, psophia_tree, psophia_poly)

  ## Not run: 
    # plot the tree in 3D
    phylo.3d(df3, z.scale = 10, pts = TRUE)

    # add the polygons representing the tip distributions
    add.polygons(df3)

    # add the posterior density at each node of the 3d tree
    add.dens(df3, mcmc, z.scale = 10, col = c(2:8))
  
## End(Not run)

ignacioq/rase documentation built on Feb. 20, 2022, 3:16 p.m.