View source: R/FlattenAnswers.R
| FlattenAnswers | R Documentation |
Converts the output of GetAnswers into a single flat
data.frame. Works with any form: if the form is simple (no groups or
multivalued fields), GetAnswers already returns a plain
data.frame and this function returns it unchanged. For forms with
groups or multivalued fields, the main data frame and all nested data frames
are joined using dplyr::full_join.
FlattenAnswers(answers)
answers |
The return value of |
When the form contains multivalued groups or fields, each submission may produce multiple rows in the nested data frames. Joining them to the main data frame causes row duplication: each combination of main row and nested row is represented. Account for this in any aggregation.
A single data.frame. For simple forms the columns keep their
original names. For forms with groups, main-frame columns are prefixed
with "answer." and nested-frame columns are prefixed with their
group componentId.
answers <- GetAnswers("cizio7xeohwgc8k4g4koo008kkoocwg", 5719)
FlattenAnswers(answers)
# Pipe-friendly
GetAnswers("cizio7xeohwgc8k4g4koo008kkoocwg", 5719) |> FlattenAnswers()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.