View source: R/helper_text_df_to_string.R
df_to_string | R Documentation |
Converts a data frame to a string format, intended for sending it to a LLM (or for display or logging).
df_to_string(df, how = c("wide", "long"))
df |
A |
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 |
A single string representing the df
Other text_helpers:
skim_with_labels_and_levels()
,
vector_list_to_string()
cars |>
head(5) |>
df_to_string(how = "wide")
cars |>
head(5) |>
df_to_string(how = "long")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.