get_tipranges_to_BioGeoBEARS: Generates lagrangePHYLIP file for using in BioGeoBEARS

View source: R/tipranges_to_BioGeoBEARS.R

get_tipranges_to_BioGeoBEARSR Documentation

Generates lagrangePHYLIP file for using in BioGeoBEARS

Description

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.

Usage

get_tipranges_to_BioGeoBEARS(
  tip_range,
  filename = "lagrange_area_data_file.data",
  areanames = NULL
)

Arguments

tip_range

data frame. Tip names in rows, geographical areas in columns. Please provide the tip names as row.names. See example.

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.

Examples

## 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)
 

GabrielNakamura/Rrodotus documentation built on Aug. 31, 2023, 2:13 p.m.