Table Of Contents

6.15. R

6.15.1. Introduction


Our R API is currently in alpha release and is not recommended for production

This document is an introduction to the quasardb R API. It is primarily focused on timeseries, and will guide you through the various ways you can interact with the QuasarDB backend.

6.15.2. Requirements

6.15.3. Installation

On Unix-like systems, if you have quasardb C API installed system-wide, you can install quasardb R API directly from GitHub as follows:

if (!requireNamespace("devtools", quietly = TRUE)) {

For instructions on how to perform a clean build of the extension from source, please look at our GitHub repository.

6.15.4. Usage

Require the R library, and verify the C API version:


Establishing a connection

Connect to a QuasarDB cluster:

handle <- connect("qdb://")

Creating a timeseries

ts_create(handle, name = "timeseries1",
          columns = c("column1" = ColumnType$Blob, "column2" = ColumnType$Double))

This will create a timeseries with the a default shard size of 24h.

Retrieving timeseries

QuasarDB allows you to organise many different timeseries by tag. To look up these timeseries by tag, use the query_find:

keys <- query_find(handle, "find(tag='nyse' and type=ts)")

Executing queries

You can execute queries directly in R and process their results:

result <- query_find(handle, "select first(open), max(high) from find(tag='nasdaq' and type=ts) in range(today, -1y) group by day")
6.14. Python
Next arrow_forward
6.16. REST API