load.taxon.metadata: Function to read and process taxon metadata file

View source: R/load.taxon.metadata.R

load.taxon.metadataR Documentation

Function to read and process taxon metadata file

Description

This function reads and process a user specified metadata file or data frame. It assumes that the file is in text format and that the columns are tab-delimited. Metadata provided in any other format other than as a 'character' class file name or a data frame with class "tbl_df", "tbl","grouped_df","data.frame" or "rowwise_df" will not be accepted. When not specified, it will assume that the first column represents the taxon names. The taxon names should match those included in the phylogenetic tree file or object

Usage

load.taxon.metadata(
  taxon.metadata.file,
  taxon.metadata.columns = NULL,
  taxon.names = NULL,
  taxon.id.column = NULL,
  include.first.col = FALSE,
  taxon.metadata.delimiter = "\t"
)

Arguments

taxon.metadata.file

Path to the input metadata file name or data frame.

taxon.metadata.columns

A vector containing name of columns in the matadata file or data frame to view in the phylogenetic tree.

taxon.names

A vector containing taxon names to select from the metadata file or data frames. These names must match the taxon names in the phylogenetic tree.

taxon.id.column

Column name in the matadata file or data frame containing taxon names.

include.first.col

A Boolean value specifying whether to use the first column as the taxon names.

taxon.metadata.delimiter

A delimiter separating metadata columns.

Value

A data frame containing selected metadata columns and taxon names in the phylogenetic tree.

Author(s)

Chrispin Chaguza, Chrispin.Chaguza@gmail.com

References

https://github.com/ChrispinChaguza/RCandy

Examples

## Not run: 
Read a tab-delimited file containing metadata

metadata.file<-system.file("extdata", "ST320.tsv", package = "RCandy",mustWork = TRUE)

metadata.df<-load.taxon.metadata(metadata.file)

## End(Not run)

ChrispinChaguza/RCandy documentation built on June 23, 2022, 1:03 p.m.