call: Make HTTP request to openblender.io services

Description Usage Arguments Value See Also Examples

View source: R/openblender.R

Description

Call 'OpenBlender' API services.

Usage

1
call(action, parameters)

Arguments

action

Task you're requesting

parameters

Request options

Value

A list that includes the new dataset id in case you create one, success/error message when you insert observations or the list of observations requested.

See Also

To see more details go to openblender.io

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
## Not run: 
#CREATE DATASET
df <- read.csv(file = "/path/to/your/data.csv", header = TRUE, sep = ",")
action <- "API_createDataset"
parameters <- list(
token = "YOUR TOKEN",
id_user = "YOUR USER ID",
name = "Assign a name",
descriptipon = "Set a description",
visibility = "public",
tags = list("topic", "tag"),
insert_observations = "off",# set "on" if you want include the observations
dataframe = df
)
call(action, parameters)
#INSERT OBSERVATIONS
df <- read.csv(file = "/path/to/your/data.csv", header = TRUE, sep = ",")
action <- "API_insertObservations"
parameters <- list(
token = "YOUR TOKEN",
id_user = "YOUR USER ID",
id_dataset = "DATASET ID",
notification = "on",
observations = df
)
call(action, parameters)

#GET OBSERVATIONS
action <- "API_getObservationsFromDataset"
parameters <- list(
token = "YOUR TOKEN",
id_user = "YOUR USER ID",
id_dataset = "DATASET ID"
)
call(action, parameters)

## End(Not run)

openblender documentation built on July 4, 2020, 3:01 a.m.