Skip to content
R package for ETL
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
R
man
tests
.Rbuildignore
.gitignore
DESCRIPTION
LICENSE
LICENSE.md
NAMESPACE
README.Rmd
README.md

README.md

RETL

RETL is an R package that aims to provide practical tools for ETL processes using R’s wide range of APIs to data sources.

It is intended to be used together with the Rflows package (not yet open-sourced) as universal API to data stored in databases, files, excel sheets. RETL relies heavily on the data.table package.

Installation

RETL can be installed from GitHub by running:

devtools::install_github("vh-d/RETL")

Examples

library(RETL)
library(magrittr)

# establish connections
my_db <- DBI::dbConnect(RSQLite::SQLite(), "path/to/my.db")
your_csv <- "path/to/your.csv"
your_db <- dbConnect(RMariaDB::MariaDB(), group = "your-db")

Pipes

# simple extract and load
etl_read(from = my_db, name = "customers") %>% etl_write(to = your_csv)

# extract -> transform -> load
etl_read(from = my_db, name = "orders") %>% # extract from a database
  dbq(, order_year := year(order_date)) %>% # transform (adding a new column)
  etl_write(to = your_db, name = "customers") # load

Other tools

set_index(table = "customers", c("id", "order_year"), your_db)
You can’t perform that action at this time.