Get category ids from string

vpr_category(x, categories)

Arguments

x

A chr string which represents file paths from which category should be extracted

categories

A list object with all the potential classification categories

Value

A chr string of only the category id

Note

This function searches for exact matches to categories within '/' file separators. You may encounter errors if

See also

Author

K Sorochan

Examples

category_string <- 'C:/data/cruise/autoid/Calanus/d000/h00'
categories <- list("Calanus", "marine_snow", "blurry", "other_copepod")
vpr_category(category_string, categories)
#> [1] "Calanus"