View source: R/cast_cs_field.R
cast_cs_field | R Documentation |
Builds a character (comma) separated list within a field given a data frame with primary field repeating values and secondary field with values to be character separated in the same field (secondary)
cast_cs_field(
data,
pri,
sec,
duplicate = FALSE,
sepchar = ",",
verbose = FALSE
)
data |
data frame containing primary and secondary data columns |
pri |
Primary field name (repeating values) |
sec |
Secondary field (values would be added to same record, comma separated) |
duplicate |
If true, duplicate entries are allowed in secondary field |
sepchar |
Character separator between the data items. Default is comma |
verbose |
verbose output, Default: FALSE |
a data frame with two fields Primary and secondary (comma separated list)
Other List functions:
DwC2taxo()
,
compact_ids()
,
get_synonyms()
,
match_lists()
,
melt_cs_field()
,
merge_lists()
,
syn2taxo()
,
synonymize_subspecies()
,
taxo2DwC()
,
taxo2doc()
,
taxo2syn()
,
wiki2taxo()
SynList <- data.frame("canonical" = c("Abrothrix longipilis",
"Abrothrix longipilis",
"Abrothrix longipilis",
"Abrothrix longipilis",
"Abrothrix jelskii",
"Abrothrix jelskii"),
"synonym" = c("Akodon longipilis",
"Acodon hirtus",
"Akodon longipilis apta",
"Akodon longipilis castaneus",
"Chroeomys jelskii",
"Acodon jelskii pyrrhotis"),
stringsAsFactors = FALSE)
cast_cs_field(SynList,"canonical","synonym")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.