A package of R functions to interact with the Adaptix platform API by Sensewaves.
You will need an Adaptix account to use this R package. To get one, get in touch.
Currently only available through this repo.
devtools::install_github("Sensewaves/AdaptixR")
library(AdaptixR)
conn <- AdaptixConnect(url = "https://alpha.adaptix.io/api", api.key = "your_adaptix_key")
# Create a stream
my.new.stream <- AdaptixCreateStream(conn = conn,
name = "my_new_stream")
# Create a data frame with some time series data - timestamps must be ISO8601 compliant
points.df <- data.frame(at = ConvertDateToISO8601(c("2017-01-01", "2017-01-02", "2017-01-03", "2017-01-04", "2017-01-05")),
value = c(11.5, 43.0, 15.4, 41.1, 12.2))
# Publish the points in the stream
AdaptixPublishPoints(conn = conn, stream = my.new.stream$id, points = points.df)
# [1] "https://alpha.adaptix.io/api/streams/{stream id}/points"
AdaptixGetPoints(conn = conn, stream = my.new.stream$id)
# value at
# 1 1.0 2017-01-01
# 2 1.1 2017-01-02
# 3 1.2 2017-01-03
# Request a forecast for the next 48h on our stream
forecast.response <- AdaptixForecast(conn = conn,
stream = my.new.stream$id,
span = "48h")
# Parse forecasted scenarios
AdaptixForecastPointsToDataframe(AdaptixGetForecastScenarios(forecast.response))
# 1 at
# 1 43.00 2017-01-05
# 2 28.25 2017-01-06
# ...