vector_list_to_string {tidyprompt} | R Documentation |
Convert a named or unnamed list/vector to a string representation
Description
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"))
Arguments
obj |
A list or vector (named or unnamed) to be converted to a string. |
how |
In what way the object should be converted to a string; either "inline" or "expanded". "inline" presents all key-value pairs or values as a single line. "expanded" presents each key-value pair or value on a separate line. |
Value
A single string representing the list/vector.
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")
vector_list_to_string(named_vector, how = "expanded")
[Package tidyprompt version 0.0.1 Index]