akgold / do4ds

A book on DevOps for Data Scientists with CRC Press.
https://do4ds.com
Other
130 stars 27 forks source link

Chap 3 Lab Step 1: dependency on {dbplyr} #223

Closed youngroklee-ml closed 5 months ago

youngroklee-ml commented 8 months ago

Chapter 3. Databases and Data APIs > Lab: Use a database and an API > Step 1: Put the data in DuckDB

df <- dplyr::tbl(con, "penguins") returns an error if {dbplyr} has not been installed. After installing {dbplyr}, it works fine.

con <- DBI::dbConnect(
    duckdb::duckdb(),
    dbdir = "my-db.duckdb"
)
df <- dplyr::tbl(con, "penguins")
#> Error: ident_q requires the dbplyr package, please install it first and try again

Created on 2023-12-11 with reprex v2.0.2

Session info ``` r sessionInfo() #> R version 4.3.2 (2023-10-31) #> Platform: aarch64-apple-darwin20 (64-bit) #> Running under: macOS Sonoma 14.1.2 #> #> Matrix products: default #> BLAS: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRblas.0.dylib #> LAPACK: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/lib/libRlapack.dylib; LAPACK version 3.11.0 #> #> locale: #> [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8 #> #> time zone: America/New_York #> tzcode source: internal #> #> attached base packages: #> [1] stats graphics grDevices utils datasets methods base #> #> loaded via a namespace (and not attached): #> [1] vctrs_0.6.5 cli_3.6.1 knitr_1.45 rlang_1.1.2 #> [5] xfun_0.41 DBI_1.1.3 generics_0.1.3 glue_1.6.2 #> [9] htmltools_0.5.7 fansi_1.0.5 rmarkdown_2.25 evaluate_0.23 #> [13] tibble_3.2.1 fastmap_1.1.1 yaml_2.3.7 lifecycle_1.0.4 #> [17] duckdb_0.9.2-1 compiler_4.3.2 dplyr_1.1.4 fs_1.6.3 #> [21] pkgconfig_2.0.3 rstudioapi_0.15.0 digest_0.6.33 R6_2.5.1 #> [25] reprex_2.0.2 tidyselect_1.2.0 utf8_1.2.4 pillar_1.9.0 #> [29] magrittr_2.0.3 tools_4.3.2 withr_2.5.2 ```