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"))
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()