relabel: Relabel categories, possibly regrouping them

Description Usage Arguments See Also Examples

Description

Relabel categories, possibly regrouping them

Usage

1

Arguments

x

vector of categories (usually the "Valid" column of the data.frame produced by read_ids)

labels

a two columns data.frame or matrix with the old names in the first column and the new name in the second column; if some new names are equal, this effectively regroups the categories

See Also

regroup_taxa

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
x <- c("append_fritill", "append_housing", "crust_copepods_calanus", "crust_copepods_euchaeta", "crust_larvae", "append_fritill")

# change labels
labels <- data.frame(old=c("append_fritill", "append_housing"), new=c("larvacean_fritill", "larvacean_housing"))
relabel(x, labels=labels)

# combine some groups (see regroup_taxa for a more generic way of doing this)
grouping <- data.frame(old=c("append_fritill", "append_housing"), new="appendicularians")
print(grouping)
relabel(x, labels=grouping)

jiho/zooprocessr documentation built on May 19, 2019, 10:31 a.m.