Fetch the data from a ClimMob project using an application programming interface (API) key
getDataCM(
key,
project,
userowner,
as.data.frame = TRUE,
as.text = FALSE,
server = "climmob3",
...
)
# S3 method for CM_list
as.data.frame(x, ..., tidynames = TRUE, pivot.wider = FALSE)
a character for the user's application programming interface (API) key
a character for the project id
a character for user name of project's owner
logical, to return a data frame
logical, to return a text file that can be parsed to json
optional, a character to select from which server the data will be retrieved. See details
additional arguments passed to methods
an object of class CM_list
logical, TRUE
make clean column names
logical, if TRUE
return a wider object
where each tricot package is a row
An object of class 'CM_list' or a text file or a data.frame with class "CM_df" with the variables:
the participant's package id
the data collection moment
the variable name
the value for each variable
server
: the default server is "climmob" used for clients of
https://climmob.net/climmob3/, other options are:
"1000farms" for clients of https://1000farms.climmob.net/
ClimMob website https://climmob.net/
Other GET functions:
getProjectProgress()
,
getProjectsCM()
if (FALSE) { # interactive()
# This function only works with an API key
# the API key can be obtained once a free ClimMob account
# is created via https://climmob.net/
library("ClimMobTools")
my_key <- "ff05a174-28d0-4a40-ab5a-35dc486133a6"
getDataCM(key = my_key,
project = "beanaru23",
userowner = "student",
server = "1000farms")
# get in the wide format
getDataCM(key = my_key,
project = "beanaru23",
userowner = "student",
server = "1000farms",
pivot.wider = TRUE)
}