build_location_description: Build Location Description

View source: R/fallingfruit.R

build_location_descriptionR Documentation

Build Location Description

Description

Builds a description from its inputs. When merge is TRUE, all content is summarized as one group, and all notes not equal throughout are discarded. Otherwise, all content is preserved and only grouped for equal types with all equal notes.

Usage

build_location_description(type_strings, notes = NULL, merge = FALSE,
  type_sep = ", ", note_sep = ". ", group_sep = "<br>",
  frequency = TRUE, frequency_in = "[]")

Arguments

type_strings

Character vector interpreted literally (comma-delimited lists are not split).

notes

List of character vectors, each of the same length.

merge

Whether to merge types, discarding any notes that are not equal for all types.

type_sep

Character string to seperate each element in type_strings when merge = TRUE.

note_sep

Character string to seperate each retained element in notes.

group_sep

Character string to seperate each grouping when merge = FALSE.

frequency

Whether to display frequency before each element in type_strings.

frequency_in

String of two characters in which to display the frequencies.

Value

Character string of the summarized and concatenated values.

See Also

Other Falling Fruit functions: build_location_descriptions, build_type_strings, expand_category_mask, get_ff_types, match_type_strings, normalize_type_strings, parse_type_strings

Examples

type_strings <- c("Apple", "Pear", "Pear")
notes <- list(
  c("Planted 1999", "Height 10 m"),
  c("Planted 1999", "Height 20 m"),
  c("Planted 1999", "Height 20 m")
)
build_location_description(type_strings, notes)
build_location_description(type_strings, notes, merge = TRUE)

falling-fruit/fruitr documentation built on Dec. 21, 2024, 8:32 p.m.