Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/eitsupi/r-glaredb

R bindings for GlareDB
https://github.com/eitsupi/r-glaredb

arrow glaredb r rust sql

Last synced: 2 months ago
JSON representation

R bindings for GlareDB

Awesome Lists containing this project

README

        

---
output:
github_document:
html_preview: false
---

```{r}
#| include: false

knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```

# R bindings for GlareDB

[![R-multiverse status](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fcommunity.r-multiverse.org%2Fapi%2Fpackages%2Fglaredb&query=%24.Version&label=r-multiverse)](https://community.r-multiverse.org/glaredb)
[![glaredb status badge](https://eitsupi.r-universe.dev/badges/glaredb)](https://eitsupi.r-universe.dev/glaredb)
[![CRAN status](https://www.r-pkg.org/badges/version/glaredb)](https://CRAN.R-project.org/package=glaredb)

This package is based on GlareDB `r as.data.frame(glaredb_sql("select version()"))$version`.

Check out the [GlareDB repo](https://github.com/GlareDB/glaredb) for details.

## Installation

This package can be installed from R-multiverse.
If available, a binary package will be installed.

**Currently, Windows is not supported. Please use WSL2.**

```r
Sys.setenv(NOT_CRAN = "true")
install.packages("glaredb", repos = "https://community.r-multiverse.org")
```

## Examples

Use GlareDB directly in R to query and analyzer a variety of data sources, including `arrow::Table` and `polars::RPolarsDataFrame`.

```{r}
library(glaredb)
library(polars)

df <- pl$DataFrame(
A = 1:5,
fruits = c("banana", "banana", "apple", "apple", "banana"),
B = 5:1,
C = c("beetle", "audi", "beetle", "beetle", "beetle")
)

df2 <- glaredb_sql("select * from df where fruits = 'banana'") |>
as_polars_df()

df2
```