Convert a named or unnamed list/vector to a string representation
Source:R/helper_text_vector_list_to_string.R
vector_list_to_string.Rd
Converts a named or unnamed list/vector to a string format, intended for sending it to an LLM (or for display or logging).
Usage
vector_list_to_string(obj, how = c("inline", "expanded"))
See also
Other text_helpers:
df_to_string()
,
skim_with_labels_and_levels()
Examples
named_vector <- c(x = 10, y = 20, z = 30)
vector_list_to_string(named_vector, how = "inline")
#> [1] "x: 10, y: 20, z: 30"
vector_list_to_string(named_vector, how = "expanded")
#> [1] "x: 10\ny: 20\nz: 30"