Download survey data from Forsta and load it in R.
Usage
forsta_get_data(
survey_id,
condition = "qualified",
use_metadata = TRUE,
label_delim = " | ",
verbose = FALSE,
decipher_key = Sys.getenv("DECIPHER_KEY")
)Arguments
- survey_id
Survey ID (e.g., "selfserve/57a/250403").
- condition
Character. The condition to use for filtering the data. Available keywords:
all,qualified,terminated,overquota,partials,everything. Default isqualified, which means that only qualified responses will be returned.- use_metadata
Logical. If
TRUE, function will download metadata and attach it as attribute. Function will also fix brokenlabelsandlevelsdue to character limitations in SPSS format (255 char/120 char).- label_delim
Character. The delimiter to use for the labels. Default is " | ".
- verbose
Logical. If
TRUE, the function will print information about fixing labels and levels.- decipher_key
Character. The API key for Forsta. If not provided, it will look for the
DECIPHER_KEYenvironment variable.