regroup.equivalent | R Documentation |
Regroup based on the old or the new data frame using a direction parameter.
regroup.equivalent(df, gnsp.old, gnsp.new, clmns, agg='mean', direction='old2new')
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 |
a regrouped data frame
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')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.