View source: R/tipranges_to_BioGeoBEARS.R
get_tipranges_to_BioGeoBEARS | R Documentation |
It prepares and save the file to be used as geographical areas in BioGeoBEARS
scripts. It was based on save_tipranges_to_LagrangePHYLIP
function of
BioGEOBEARS
package.
get_tipranges_to_BioGeoBEARS(
tip_range,
filename = "lagrange_area_data_file.data",
areanames = NULL
)
tip_range |
data frame. Tip names in rows, geographical areas in columns.
Please provide the tip names as |
filename |
filename to store the data. By default it is "lagrange_area_data_file.data". |
areanames |
the names of the areas. By defaut the area names are generated as sequencial upper case letters. |
## Not run:
set.seed(082622)
geo.areas <- data.frame(
a = rbinom(5, 1, 0.5),
b = rbinom(5, 1, 0.5),
c = rbinom(5, 1, 0.5)
)
# set the row names
row.names(geo.areas) <- paste0("tip_", 1:nrow(geo.areas))
# it saves the data at 'filename' path.
get_tipranges_to_BioGeoBEARS(
geo.areas,
filename = "lagrange_area_data_file.data",
areanames = NULL)
)
# file content must be like this:
# 5 3 (A B C)
# tip_1 111
# tip_2 001
# tip_3 010
# tip_4 101
# tip_5 010
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.