Learn R Programming

BioGeoBEARS (version 0.2.1)

corner_coords: Get the corner coordinates

Description

Gets the coordinates of the corners when the tree is plotted.

Usage

corner_coords(tr, coords_fun = "plot_phylo3_nodecoords", tmplocation = "manual")

Arguments

tr
A tree object in phylo format.
coords_fun
The name of the function to use to get node coordinates. Default: "plot_phylo3_nodecoords".
tmplocation
Default is "manual", which throws an error check unless your path structure matches the developer's. Most users should probably use the system.file command in the examples, below. The directory location containing the R script plot_phylo3_nodecoords.R. This function, modified from the ape function plot.phylo, cannot be included directly in the R package as it contains C code that does not pass CRAN's R CMD check. The default, cornercoords_loc="manual", will not allow split states to be plot. The R script plot_phylo3_nodecoords.R is located in the BioGeoBEARS extension data directory, extdata/a_scripts. You should be able to get the full path with list.files(system.file("extdata/a_scripts", package="BioGeoBEARS"), full.names=TRUE).

Value

corners_list

Details

Because this function needs to use a modified version of the APE plot.phylo function, and for complex reasons APE's .C functions cannot be used elsewhere without causing problems with R CMD check, this function is left up to user specification. Basically, the user puts in the name of the function, which is available in the extension data (extdata/a_scripts) directory of the package. The defaults work on the developer's machine, other users may have to e.g. change "manual" to tmplocation, where tmplocation is specified as in the example.

References

http://phylo.wikidot.com/matzke-2013-international-biogeography-society-poster

Matzke_2012_IBS

See Also

phylo, get_nodenums

Examples

Run this code
# Set location like this if you don't have plot_phylo3_nodecoords
# hardcoded/sourced elsehwhere
# tmplocation = np(system.file("extdata/a_scripts", package="BioGeoBEARS"))
#
## Not run: 
# extdata_dir = np(system.file("extdata", package="BioGeoBEARS"))
# trfn = np(paste(extdata_dir, "/Psychotria_5.2.newick", sep=""))
# tr = read.tree(trfn)
# tmplocation = np(system.file("extdata/a_scripts", package="BioGeoBEARS"))
# corner_coords(tr, coords_fun="plot_phylo3_nodecoords", tmplocation=tmplocation)
# ## End(Not run)

Run the code above in your browser using DataLab