as.data.frame.formr_item_list: Transform formr_item_list into a data.frame for ease of use

View source: R/connect_to_formr.R

as.data.frame.formr_item_listR Documentation

Transform formr_item_list into a data.frame for ease of use

Description

This function just turns a formr_item_list into a data.frame. The reason, these lists don't come as data.frames as default is because the 'choices' are a list themselves. When transforming, the choice column contains a collapsed choice list, which may be less useful for some purposes.

Usage

## S3 method for class 'formr_item_list'
as.data.frame(x, row.names, ...)

Arguments

x

a formr_item_list

row.names

not used

...

not used

Examples

## Not run: 
formr_connect(email = 'you@example.net', password = 'zebrafinch' )
as.data.frame(formr_items(survey_name = 'training_diary' ))

## End(Not run)
items = formr_items(path = 
system.file('extdata/gods_example_items.json', package = 'formr', mustWork = TRUE))
items_df = as.data.frame(items)
items_df[1,]

rubenarslan/formr documentation built on Feb. 6, 2024, 1:18 a.m.