formr_simulate_from_items: Simulate data based on item table

Description Usage Arguments Examples

View source: R/connect_to_formr.R

Description

Once you've retrieved an item table using formr_items() you can use this function to sample data from the possible choices. At the moment random data is only generated for choice-type items and numeric ones, as these are most likely to enter data analysis. Does not yet handle dates, times, text, locations, colors

Usage

1
formr_simulate_from_items(item_list, n = 300)

Arguments

item_list

the result of a call to formr_connect()

n

defaults to 300

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
formr_connect(email = 'you@example.net', password = 'zebrafinch' )
sim = formr_simulate_from_items(item_list = formr_items('training_diary'), n = 100)
summary(lm(pushups ~ pullups, data = sim))

## End(Not run)
items = formr_items(path = 
system.file('extdata/gods_example_items.json', package = 'formr', mustWork = TRUE))
fakedata = formr_simulate_from_items(items, n = 20)
fakedata[1:2,]

grebbel/formr_test documentation built on May 17, 2019, 8:34 a.m.