Learn R Programming

RTD

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 or RJDBC for querying.

Requirements

To upload data.frame from R, there are two options:

  1. embulk
  2. bulk-import

If you want to use embulk, ensure you've installed embulk and set PATH for it.

Install

As of version 0.4.1, RTD has been back to CRAN. You can install RTD as:

install.packages("RTD")

You can install via devtools::install_github for the latest development version.

install.packages("devtools") # Install devtools if needed
devtools::install_github("treasure-data/RTD@v0.4.1")

Or, you can use install-github.me instead like:

source("https://install-github.me/treasure-data/RTD@v0.4.1")

Example

See also RTD_example.Rmd or RPubs.

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")

Copy Link

Version

Install

install.packages('RTD')

Monthly Downloads

173

Version

0.4.2

License

Apache License 2.0 | file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

Aki Ariga

Last Published

December 8th, 2025

Functions in RTD (0.4.2)

list_databases

Show database list
exist_database

Check table existence
show_bulk_import

Show bulk import
list_bulk_imports

List bulk imports
list_bulk_import_parts

List bulk import parts
list_tables

Show list of tables
td_upload

Upload data.frame to TD
unfreeze_bulk_import

Unfreeze bulk import part
freeze_bulk_import

Freeze bulk import part
wait_bulk_import

Wait bulk import until finished
update_schema

Update schema of a table
Td

Connect to TD
commit_bulk_import

Commit bulk import part
create_bulk_import

Create bulk import
bulk_import_upload_part

Upload bulk import part
bulk_import_error_records

Show bulk import error records
delete_database

Delete a database
delete_bulk_import

Delete bulk import
create_table

Create a table
create_database

Create a database
exist_table

Check table existence
bulk_import_delete_part

Delete bulk import part
perform_bulk_import

Perform bulk import part
delete_table

Delete a table