Type: Package
Title: Access your Coletum's Data from API
Version: 0.2.2
Maintainer: André Smaniotto <smaniotto@geosapiens.com.br>
Description: Get your data (forms, structures, answers) from Coletum https://coletum.com to handle and analyse.
License: LGPL-3
URL: https://github.com/geo-sapiens/RColetum
BugReports: https://github.com/geo-sapiens/RColetum/issues
Encoding: UTF-8
Imports: httr, jsonlite, dplyr, stats
RoxygenNote: 6.1.1
Suggests: testthat
NeedsCompilation: no
Packaged: 2022-10-20 23:08:21 UTC; andresmaniotto
Author: André Smaniotto [aut, cre], Marcelo Magnani [aut], Rodrigo Sant'Ana [aut], GeoSapiens [cph, fnd]
Repository: CRAN
Date/Publication: 2022-10-20 23:47:50 UTC

RColetum

Description

An R package to get data from Coletum.

RColetum functions

The currents functions that are provide by RColetum are:

Author(s)

Maintainer: André Smaniotto smaniotto@geosapiens.com.br

Authors:

Other contributors:

See Also

Useful links:


Get all the answers of a form.

Description

Get all the currents answers of a specific form. This function makes a call to GetFormStructure and spent 2 quotas.

Usage

GetAnswers(token, idForm, nameForm = NULL, singleDataFrame = FALSE,
  source = NULL, createdAfter = NULL, createdBefore = NULL,
  createdDeviceAfter = NULL, createdDeviceBefore = NULL,
  updatedAfter = NULL, updatedBefore = NULL)

Arguments

token

String access token.

idForm

Numeric Id of the required form.

nameForm

String name of the required form. Just is used when an idForm is not supplied. When this parameter is used, are spent extra one access quota.

singleDataFrame

Boolean flag. Indicates the preference to create a single data frame with all the answers. In this case, is possible to have repeated values, according to the multiplicity of relationships.

source

Optional filter. Is the the source of the answer and can use "web_public", "web_private" or "mobile".

createdAfter

Optional filter. This parameter filters the answers that were answered after this date. Is acceptable in the ISO8601 format ("YYYY-MM-DD" or "YYYY-MM-DDThh:mm:ssTZD").

createdBefore

Optional filter. This parameter filters the answers that were answered before this date. Is acceptable in the ISO8601 format ("YYYY-MM-DD" or "YYYY-MM-DDThh:mm:ssTZD").

createdDeviceAfter

Optional filter. This parameter filters the answers that were answered after this date on device time. Is acceptable in the ISO8601 format ("YYYY-MM-DD" or "YYYY-MM-DDThh:mm:ssTZD").

createdDeviceBefore

Optional filter. This parameter filters the answers that were answered before this date on device time. Is acceptable in the ISO8601 format ("YYYY-MM-DD" or "YYYY-MM-DDThh:mm:ssTZD").

updatedAfter

Optional filter. This parameter filters the answers that were updated after this date. Is acceptable in the ISO8601 format ("YYYY-MM-DD" or "YYYY-MM-DDThh:mm:ssTZD").

updatedBefore

Optional filter. This parameter filters the answers that were updated before this date. Is acceptable in the ISO8601 format ("YYYY-MM-DD" or "YYYY-MM-DDThh:mm:ssTZD").

Details

To get more details about the fields provided by the result, please visit the API documentation.

Value

A list, with one or more data frames.

Examples


GetAnswers("cizio7xeohwgc8k4g4koo008kkoocwg", 5705)
GetAnswers("cizio7xeohwgc8k4g4koo008kkoocwg", ,"RColetum Test - Iris", TRUE)
GetAnswers(token = "cizio7xeohwgc8k4g4koo008kkoocwg",
             nameForm = "RColetum Test - Iris")
GetAnswers(token = "cizio7xeohwgc8k4g4koo008kkoocwg",
             idForm = 5705,
             source = NULL,
             createdAfter = "2012-12-20",
             createdBefore = "2018-12-20"
             )
GetAnswers(token = "cizio7xeohwgc8k4g4koo008kkoocwg",
             idForm = 5705,
             source = NULL,
             createdAfter = "2012-12-20",
             createdBefore = "2018-12-20T19:20:30+01:00"
             )
GetAnswers(token = "cizio7xeohwgc8k4g4koo008kkoocwg",
             idForm = 5705,
             source = NULL,
             createdAfter = "2012-12-20T19:20:30Z",
             createdBefore = "2018-12-20T19:20:30+01:00"
             )
GetAnswers(token = "cizio7xeohwgc8k4g4koo008kkoocwg",
             idForm = 5705,
             source = "web_public",
             createdAfter = "2012-12-20T19:20:30+01:00",
             createdBefore = "2018-12-20T19:20:30+01:00"
             )
GetAnswers(token = "cizio7xeohwgc8k4g4koo008kkoocwg",
             idForm = 5705,
             singleDataFrame = TRUE,
             source = "web_private",
             createdAfter = "2012-12-20T19:20:30Z",
             createdBefore = "2018-12-20T19:20:30Z"
             )
GetAnswers(token = "cizio7xeohwgc8k4g4koo008kkoocwg",
             idForm = 5705,
             singleDataFrame = TRUE,
             source = "web_private",
             createdAfter = "2012-12-20T19:20:30Z",
             createdBefore = "2018-12-20T19:20:30Z",
             createdDeviceAfter = "2012-12-20T19:20:30Z",
             createdDeviceBefore = "2018-12-20T19:20:30Z",
             updatedAfter = "2018-05-20T19:20:30Z",
             updatedBefore = "2018-06-20T19:20:30Z"
             )



Get the form structure of a form.

Description

Get the structure of the questions of a specific form in the shape a nested data frame, that contains all the needed information to request the answers of the form.

Usage

GetFormStructure(token, idForm, nameForm = NULL, componentId = NULL)

Arguments

token

A string access token.

idForm

Numeric Id of the required form.

nameForm

String name of the required form. Just is used when an idForm are not supplied. When this parameter is used, are spent extra one access quota.

componentId

Optional filter. That is the field identifier, it's possible use to filter to get a specific field.

Details

To get more details about the fields provided by the result, please visit the API documentation.

Value

A possible nested data frame.

Examples


GetFormStructure("cizio7xeohwgc8k4g4koo008kkoocwg", 5705)
GetFormStructure("cizio7xeohwgc8k4g4koo008kkoocwg", , "RColetum Test - Iris")
GetFormStructure(token = "cizio7xeohwgc8k4g4koo008kkoocwg",
                nameForm = "RColetum Test - Iris")


Get info of all forms.

Description

Get the principals info of all forms.

Usage

GetForms(token, status = NULL, publicAnswers = NULL,
  answerTracking = NULL)

Arguments

token

String access token.

status

Optional filter. That is the state of the form: accept "enabled" or "disabled".

publicAnswers

Optional filter. Indicates if the form is public or not, is possible to use "true" or "false".

answerTracking

Optional filter. Indicates if the form is saving the local of fill, is possible use "true" or "false".

Details

To get more details about the fields provided by the result, please visit the API documentation.

Value

A data frame.

Examples


GetForms("cizio7xeohwgc8k4g4koo008kkoocwg")
GetForms("cizio7xeohwgc8k4g4koo008kkoocwg","enabled","true","true")
GetForms(token = "cizio7xeohwgc8k4g4koo008kkoocwg",
           status = "enabled",
           publicAnswers = "false",
           answerTracking = "true"
         )