# Instantiate the etl object
cars <- etl("mtcars")
str(cars)
is.etl(cars)
summary(cars)
if (FALSE) {
# connect to a PostgreSQL server
if (require(RPostgreSQL)) {
db <- src_postgres("mtcars", user = "postgres", host = "localhost")
cars <- etl("mtcars", db)
}
}
# Do it step-by-step
cars |>
etl_extract() |>
etl_transform() |>
etl_load()
src_tbls(cars)
cars |>
tbl("mtcars") |>
group_by(cyl) |>
summarize(N = n(), mean_mpg = mean(mpg))
# Do it all in one step
cars2 <- etl("mtcars")
cars2 |>
etl_update()
src_tbls(cars2)
# generic summary function provides information about the object
cars <- etl("mtcars")
summary(cars)
cars <- etl("mtcars")
# returns TRUE
is.etl(cars)
# returns FALSE
is.etl("hello world")
cars <- etl("mtcars") |>
etl_create()
cars
Run the code above in your browser using DataLab