readdbtbl: [Deprecated] Create a dplyr connector to MySQL

Description Usage Arguments Details Value Examples

View source: R/database.R

Description

readdbtbl is deprecated, use dplyr::tbl instead. See example below.

Usage

1
readdbtbl(tableread)

Arguments

tableread

name of the database table to read

Details

[Deprecated] Old description

Return a dplyr tbl object for the given MySQL database table tbl objects allow lazy operations. See src_mysql. The issue is that 2 table objects created with this function will not share the same source. Therefore they will not be available for a merge within the database.

Value

a dplyr tbl object

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
# From 2017 onwards, use
con <- RMySQL::dbConnect(RMySQL::MySQL(), dbname = "tradeflows")
prod <- tbl(con, "raw_comext_product")
RMySQL::dbDisconnect(con)
# Deprecated, before 2017
readdbtbl("raw_flow_yearly") %>%
    group_by(productcode) %>%
    summarise(nrow = n()) %>%
    arrange(nrow) %>%
    kable

## End(Not run)

EuropeanForestInstitute/tradeflows documentation built on Jan. 7, 2018, 1:08 p.m.