To eaes local testing the package has was a companion package with a localized simple testing server implementing the BrAPI v1 protocol. Since Feb 2018 it is discontinued.
The server must be started in a R session separate from the one use for the BrAPI calls. The server uses by default the port 2021. This can be changed by using the port parameter: brapi::mock_server(80).
This server was discontinued.
con = ba_connect(user = "user", password = "password") %>% ba_login()
ba_crops(con) # which crops are available
ba_calls(con) # which calls are available
```
BrAPI calls are now being extensively tested using the testthat framework. The local tests are being executed against the local mock_server instance. If not present a warning message will be displayed.
Quick start in RStudio: Ctrl + Shift + T
all R functions using the brapi have a new parameter: rclass which can have up to five different values: json, list, data.frame, tibble, vector. The default value is tibble for most functions - that is it will alwways return a table. Vector is default for very small return objects like in the case of 'crops'.
also: all R functions are checked against the list of calls provided by the server. That is: if a certain server does not implement all calls the corresponding R functions will not 'insist' calling it.
NEWS.md
file to track changes to the package.Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.