This wraps build_branches() and build_hpd() and assembles a nodes data.frame so the combined object can be passed as data to the geoms (e.g. geom_phylo_branches(data = phylo_phylogeo)).

build_phylogeo(
  treedata,
  lat = "location1",
  lon = "location2",
  height_branches = "height_mean",
  height_hpd = "height_median",
  level = "0.80",
  digits = 2,
  most_recent_sample = NULL,
  debug = getOption("ggphylogeo.debug", FALSE)
)

Arguments

treedata

treedata object with phylogeographic annotations

lat

name of latitude column (default: "location2")

lon

name of longitude column (default: "location1")

height_branches

column name for branch ages (default: "height_mean")

height_hpd

column name for HPD ages (default: "height_median")

level

HPD level (default: "0.80")

digits

numeric digits for rounding coordinates (default: 2)

most_recent_sample

Date or numeric year (e.g. 2019) used to calibrate age to actual dates. If NULL (default) no calibration is performed.

debug

logical debug messages