get_delim_cols: Extract Labels and Colors from Species Delimitation...

View source: R/get_delim_cols.R

get_delim_colsR Documentation

Extract Labels and Colors from Species Delimitation Partitions

Description

get_delim_cols() returns a tbl_df format containing extracted and processed data from delim_autoplot.

Usage

get_delim_cols(p, delimname = NULL, hap_tbl = NULL)

Arguments

p

Output from delim_autoplot.

delimname

A character vector of species delimitation names (optional). If provided, the function filters the data to only include rows matching such terms. Default to NULL.

hap_tbl

output from haplotype_tbl (optional). If provided, the function will annotate color and fill data for collapsed haplotypes. Default to NULL.

Details

get_delim_cols() is a convenience function to extract labels, species partitions, color and fill data from the output of delim_autoplot in a tbl_df format. It is best used when combined with haplotype information from haplotype_tbl or when combined with other metadata, such as GPS coordinates for map plotting.

Value

an object of class tbl_df.

Author(s)

Pedro S. Bittencourt.

Examples


# plot using autoplot
p <- delim_autoplot(geophagus_delims, geophagus_beast)

# view 
p

# get haplotypes
hap_tbl <- haplotype_tbl(geophagus)

# extract colors for consensus
get_delim_cols(p, delimname= "consensus", hap_tbl= hap_tbl)



delimtools documentation built on April 3, 2025, 9:28 p.m.