collapse_or_na()joins the non-missing, non-empty values of a vector into one string, and returnsNAwhen there is none (rather than an empty string, which a database would store as a value).json_list_to_string()does the same for JSON arrays stored as text ('["Economics","History"]'), as some APIs return them. It needs the jsonlite package.
Value
collapse_or_na(): a string. json_list_to_string(): a character
vector of the same length as x.
See also
Other normalisation:
escape_regex(),
na_if_sentinel(),
normalise_for_matching(),
split_author_string()