knitr::opts_chunk$set( collapse = TRUE, eval = identical(Sys.getenv("IN_PKGDOWN"), "true") || (getRversion() >= "4.1" && rlang::is_installed(c("conflicted", "nycflights13"))), comment = "#>" ) Sys.setenv(DUCKPLYR_FALLBACK_COLLECT = 0) options(conflicts.policy = list(warn = FALSE))
library(conflicted) library(duckplyr) conflict_prefer("filter", "dplyr")
As a drop-in replacement for dplyr, duckplyr will use DuckDB for the operations only if it can, and fall back to dplyr otherwise. A fallback will not change the correctness of the results, but it may be slower or consume more memory. We would like to guide our efforts towards improving duckplyr, focusing on the features with the most impact. To this end, duckplyr collects and uploads telemetry data about fallback situations, but only if permitted by the user:
The data collected contains:
Sys.setenv(DUCKPLYR_FALLBACK_COLLECT = "") Sys.setenv(DUCKPLYR_FALLBACK_AUTOUPLOAD = "") fallback_purge()
Fallback is silent by default, but can be made verbose.
Sys.setenv(DUCKPLYR_FALLBACK_INFO = TRUE) out <- flights_df() |> summarize(.by = origin, paste(dest, collapse = " "))
After logs have been collected, the upload options are displayed the next time the duckplyr package is loaded in an R session.
duckplyr:::fallback_autoupload()
The fallback_sitrep()
function describes the current configuration and the available options.
See vignette("fallback")
for details on the fallback mechanism.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.