df_to_string: Convert a dataframe to a string representation
Description
Converts a data frame to a string format, intended for sending it to a LLM
(or for display or logging).
Usage
df_to_string(df, how = c("wide", "long"))
Value
A single string representing the df
Arguments
df
A data.frame object to be converted to a string
how
In what way the df should be converted to a string;
either "wide" or "long". "wide" presents column names on the first row,
followed by the row values on each new row. "long" presents the values
of each row together with the column names, repeating for every row
after two lines of whitespace
See Also
Other text_helpers:
skim_with_labels_and_levels(),
vector_list_to_string()