gs.rename {mmodely}R Documentation

Rename the Genus species information in a data frame

Description

This function takes a data frame (with a genus species column) and proceeds to use an external look-up table to update the names if they've been changed

Usage

gs.rename(df, alias.table.path, retro=FALSE, update.gn_sp=FALSE)

Arguments

df

a data frame with genus species information as row names and optionally in a column named "gn_sp"

alias.table.path

a file system path (e.g. 'inst/extdata/primate.taxa.aliases.tab') to a lookup table with 'old.name' and 'new.name' as columns

retro

a boolean (T/F) parameter specifying if the renaming should go from new to old instead of the default of old to new

update.gn_sp

a boolean parameter specifying if the 'gn_sp' column should also be updated with 'new.name's

Value

the original data frame with (potentially) updated row names and updated gn_sp column values

Examples


path.data <- system.file("extdata","primate-example.data.csv", package="mmodely")
data <- read.csv(path.data, row.names=1)

path.look <- system.file("extdata","primate.taxa.aliases.tab", package="mmodely")

data.renamed <- gs.rename(df=data, alias.table.path=path.look, retro=FALSE, update.gn_sp=FALSE)


[Package mmodely version 0.2.5 Index]