We define $.DBIConnection()
, $<-.DBIConnection()
and
!.tbl_lazy()
to be able to :
write in a data base with
con$foo <- my_data_frame
(where con
is a connection built with
DBI::dbConnect()
or this package's db_connect), short for
DBI::dbWriteTable(con, "foo", my_data_frame)
build a lazy table with con$foo
, short for dplyr::tbl(con, "foo")
,
so it can be used to do some server side data manipulation using dplyr
collect a lazy table into the R session with !my_lazy_table
(or directly
!con$foo
), equivalent to dplyr::collect(my_lazy_table)
or
dplyr::collect(dplyr::tbl(con, "foo"))
1 2 3 4 5 6 | if(requireNamespace("RSQLite")){
db <- db_connect("sqlite", path = ":memory:")
db$foo <- head(cars,2)
db$foo
!db$foo
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.