An R interface to the 'typeform' < https://typeform.com> application program interface. Also provides functions for downloading your results.
Typeform is a company that specialises in online form building. This R package allows users to download their form results through the exposed API.
The package can be installed from CRAN
The package can then be loaded in the usual way
To use this package, you will need a data API key. With this key in position, you can then list your available forms
api = "XXXXX"typeforms = get_typeforms(api)typeforms$content
If you don't pass your
api key as an argument, it will attempt to read the variable
typeform_api from your
.Renviron file, via
Sys.getenv("typeform_api"). If this variable is set correctly, then you can omit the
typeforms = get_typeforms()
In all function calls below, the
api argument can be ommitted if the environment variable is set (see Efficient R programming Chapter 2 for more details).
You can download data from a particular typeform via
uid = typeforms$content$uid## uid can be obtained from the typeforms data set aboveq = get_questionnaire(uid, api)
q contains a few useful components,
There are a number of options for downloading the data. For example
## Only completed formsget_questionnaire(uid, api, completed = TRUE)## Results since the 1st Janget_questionnaire(uid, api, since = as.Date("2016-01-01"))
?get_questionnaire() help page for other options.
Imagine we only want to fetch the last 10 completed responses.
completed = TRUE.
order_by = "date_submit_desc"
limit = 10
This gives the function call
get_questionnaire(uid,api,completed = TRUE,order_by = "date_submit_desc",limit = 10)
Development of this package was supported by Jumping Rivers
get_results()now depreciated. Instead, use
get_questionnaire(). This returns a list with http_status, question stats, questions, completed, and uncompleted responses (thanks to @hrbrmstr).
get_results()function (thanks to @1beb).