Learn R Programming

ClimMobTools (version 0.3.9)

getDataCM: Get ClimMob data

Description

Fetch the data from a ClimMob project using an application programming interface (API) key

Usage

getDataCM(key, project, as.data.frame = TRUE, server = "climmob3", ...)

# S3 method for CM_list as.data.frame(x, ..., tidynames = TRUE, pivot.wider = FALSE)

Arguments

key

a character for the user's application programming interface (API) key

project

a character for the project id

as.data.frame

logical, to return a data frame

server

optional, a character to select from which server the data will be retrieved. See details

...

additional arguments passed to methods

x

an object of class CM_list

tidynames

logical, if TRUE suppress ODK strings

pivot.wider

logical, if TRUE return a wider object where each observer is a row

Value

An object of class 'CM_list' or a data.frame with class "CM_df" with the variables:

id

the participant's package id

moment

the data collection moment

variable

the variable name

value

the value for each variable

Details

server: the default server is "climmob" used for clients of https://climmob.net/climmob3/, other options are:

"avisa" for clients of https://avisa.climmob.net/

"rtb" for clients of https://rtb.climmob.net/

"testing" for clients of https://testing.climmob.net/climmob3/

See Also

ClimMob website https://climmob.net/

Other GET functions: getProjectProgress(), getProjectsCM()

Examples

Run this code
# NOT RUN {
# This function will not work without an API key  
# the user API key can be obtained once a free ClimMob account 
# is created via https://climmob.net/

my_key <- "add_your_key"
my_project <- "my_climmob_project"

data <- getDataCM(key = my_key, project = my_project)

# }
# NOT RUN {
# }

Run the code above in your browser using DataLab