regroup.equivalent {primate}R Documentation

Re-group data.frame by Genus_species in either old or new dataframe

Description

Regroup based on the old or the new data frame using a direction parameter.

Usage

regroup.equivalent(df, gnsp.old, gnsp.new, clmns, agg='mean', direction='old2new')

Arguments

df

a dataframe

gnsp.old

old nomenclature

gnsp.new

new nomenclature

clmns

the columns in the data.frame to re-group

agg

the aggregation type

direction

the aggregation priority

Value

a regrouped data frame

Examples


primates.tab <- AWP.read.pkg.tab(tab.nm='dbo_tblGrovesMonkeys', id.clmn='MonkeyNumberGroves')
primates.tab <- add.gnsp.clmn(primates.tab,gn="Genus",sp="Species",rownames=FALSE,gnsp.col='gn_sp')
primates.tab <- add.gnsp.clmn(primates.tab,gn="Genus",sp="Species",rownames=FALSE,gnsp.col='gnspg')
pri.grpd <- regroup.gnsp(df=primates.tab,clmns=colnames(primates.tab), agg='max')
out <- regroup.equivalent(pri.grpd, gnsp.old=gn_sp, gnsp.new='gnspg', 
                                    clmns='MonkeyNumberGroves', agg='paste', direction='old2new')


[Package primate version 0.2.0 Index]