getDataCM: Get ClimMob data

View source: R/AAA-getDataCM.R

getDataCMR Documentation

Get ClimMob data

Description

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

Usage

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

## S3 method for class '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

userowner

a character for user name of project's owner

as.data.frame

logical, to return a data frame

as.text

logical, to return a text file that can be parsed to json

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, TRUE make clean column names

pivot.wider

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

Details

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/

Value

An object of class 'CM_list' or a text file 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

Author(s)

KauĂȘ de Sousa

See Also

ClimMob website https://climmob.net/

Other GET functions: getProjectProgress(), getProjectsCM()

Examples



# 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/

my_key <- "92cec84d-44f5-4858-9ef0-bd872496311c"

getDataCM(key = my_key,
          project = "testmark",
          userowner = "kauedesousa",
          server = "testing")


ClimMobTools documentation built on Sept. 23, 2022, 1:06 a.m.