Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/treasure-data/rtd
Simple R client for Treasure Data
https://github.com/treasure-data/rtd
r treasuredata
Last synced: 7 days ago
JSON representation
Simple R client for Treasure Data
- Host: GitHub
- URL: https://github.com/treasure-data/rtd
- Owner: treasure-data
- License: apache-2.0
- Created: 2018-12-07T10:28:48.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2023-07-12T00:52:38.000Z (over 1 year ago)
- Last Synced: 2024-12-17T19:50:11.843Z (8 days ago)
- Topics: r, treasuredata
- Language: HTML
- Homepage:
- Size: 2.47 MB
- Stars: 4
- Watchers: 68
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# RTD
![R-CMD-check](https://github.com/treasure-data/RTD/workflows/R-CMD-check/badge.svg)
RTD is an official R client for Arm Treasure Data. It aims to make it simple to handle or connect from R to TD.
Since RTD covers only basic execution on TD, we recommend to use [RPresto](https://github.com/prestodb/RPresto) or RJDBC for querying.
## Requirements
To upload data.frame from R, there are two options:
1. embulk
2. bulk-importIf you want to use embulk, ensure you've installed embulk and set PATH for it.
- [embulk](https://www.embulk.org/)
- [embulk-output-td](https://github.com/treasure-data/embulk-output-td)## Install
As of version 0.4.1, RTD has been back to CRAN. You can install RTD as:
```R
install.packages("RTD")
```You can install via `devtools::install_github` for the latest development version.
```R
install.packages("devtools") # Install devtools if needed
devtools::install_github("treasure-data/[email protected]")
```Or, you can use install-github.me instead like:
```R
source("https://install-github.me/treasure-data/[email protected]")
```## Example
See also [RTD_example.Rmd](https://github.com/treasure-data/RTD/blob/master/RTD_example.Rmd) or [RPubs](https://rpubs.com/chezou/TD-from-RPresto-RTD).
```R
library(RTD)client <- Td(apikey=Sys.getenv("TD_API_KEY"), endpoint=Sys.getenv("TD_API_SERVER"))
# Show list of databases
list_databases(client)# Create database
create_database(client, "test")# Craete table
create_table(client, "test", "example")# Delete table
delete_table(client, "test", "example")# Upload data.frame. Target database and table will be created automatically.
td_upload(client, "test", "mtcars", mtcars)# Drop database
delete_database(client, "test")
```