Skip to content

Installation Guide

Installation

DevTools

To install directly from Github, use devtools:

install.packages("devtools")
library(devtools)
install_github("UbiOps/client-library-r")

Local build

To build and install locally:

  1. Install the dependencies from CRAN

install.packages("caTools")
install.packages("httr")
install.packages("jsonlite")
install.packages("R6")
install.packages("readr")
install.packages("rjson")
install.packages("stringr")
2. Build the package

git clone https://github.com/UbiOps/client-library-r
cd client-library-r
R CMD build .
R CMD INSTALL ubiops_0.2.0.tar.gz

Troubleshooting

Getting errors while installing devtools? You may need to install some OS level packages. On Ubuntu, you can try with build-essential, libcurl4-gnutls-dev, libxml2-dev and libssl-dev.

Getting errors about LC_../LANG variables missing? You may need to export the following variables: LC_CTYPE=en_US.UTF-8 and LC_MESSAGES=en_US.UTF-8.

Usage

library(ubiops)

# 1) Use environment variables
Sys.setenv("UBIOPS_API_TOKEN" = "YOUR API TOKEN")
result <- service_status()

# 2) Or provide directly
# result <- service_status(UBIOPS_API_TOKEN = "YOUR API TOKEN")

print(result)

# Or print in JSON format
print(jsonlite::toJSON(result, auto_unbox=TRUE))

# The default API url is https://api.ubiops.com/v2.1
# Want to use a different API url? Provide `UBIOPS_API_URL`, either directly or as environment variable.

Attribution

This R package is automatically generated by the OpenAPI Generator project.