ba_connect: ba_connect

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/ba_connect.R

Description

Sets a global list variable 'brapi' that contains all parameters to connect to a BrAPI compliant online database.

Usage

1
2
3
4
ba_connect(brapiDb = NULL, secure = FALSE, protocol = "http://",
  db = "127.0.0.1", port = 2021, apipath = NULL, multicrop = FALSE,
  crop = "sweetpotato", user = "", password = "", token = "",
  granttype = "password", clientid = "rbrapi", bms = FALSE)

Arguments

brapiDb

brapiDb R object for brapi databases created by as.ba_db [default: NULL]

secure

logical TRUE/FALSE

protocol

string; default: http:// (else: https://)

db

string; default '127.0.0.1' (localhost)

port

integer; default: 80

apipath

character; default NULL

multicrop

logical; default FALSE

crop

string; default: ” (empty)

user

string; default: ” (empty)

password

string; default: ” (empty)

token

string; default: ” (empty)

granttype

string

clientid

string: default: rbrapi

bms

logical; default: FALSE

Details

If the brapi_db parameter is used it will override the other parameters; except user, password and session.

Value

connection object

Author(s)

Reinhard Simon, Maikel Verouden

See Also

Other brapiutils: as.ba_db, ba_can_internet, ba_check, ba_db, ba_login, ba_logout, is.ba_con, print.ba_con, print.ba_db_list

Examples

1
2
3
4
5
6
7
if (interactive()) {
  library(brapi)

  con <- ba_db()$testserver

  con <- ba_connect(con)
}

c5sire/brapi documentation built on Oct. 17, 2019, 11:45 a.m.