diff --git a/R/as_duckplyr_df.R b/R/as_duckplyr_df.R index d3f780e3..38015384 100644 --- a/R/as_duckplyr_df.R +++ b/R/as_duckplyr_df.R @@ -2,7 +2,10 @@ #' #' For an object of class `duckplyr_df`, #' dplyr verbs such as [mutate()], [select()] or [filter()] will attempt to use DuckDB. -#' If this is not possible for whatever reason, the original dplyr implementation is used. +#' If this is not possible, the original dplyr implementation is used. +#' +#' Set the `DUCKPLYR_FALLBACK_INFO` and `DUCKPLYR_FORCE` environment variables +#' for more control over the behavior, see [config] for more details. #' #' @param .data data frame or tibble to transform #' diff --git a/R/config.R b/R/config.R index ce82a4f6..97afcac8 100644 --- a/R/config.R +++ b/R/config.R @@ -12,7 +12,7 @@ #' @section Environment variables: #' #' `DUCKPLYR_OUTPUT_ORDER`: If `TRUE`, row output order is preserved. -#' If `FALSE`, +#' The default may change the row order where dplyr would keep it stable. #' #' `DUCKPLYR_FORCE`: If `TRUE`, fail if duckdb cannot handle a request. #' diff --git a/R/csv.R b/R/csv.R index 76ab52bb..1aff0012 100644 --- a/R/csv.R +++ b/R/csv.R @@ -34,7 +34,12 @@ #' df$a #' #' # Return as tibble: -#' df_from_file(path, "read_csv_auto", class = class(tibble())) +#' df_from_file( +#' path, +#' "read_csv", +#' options = list(delim = ",", auto_detect = TRUE), +#' class = class(tibble()) +#' ) #' #' unlink(path) df_from_file <- function(path, diff --git a/R/stats.R b/R/stats.R index 0caf39c3..17f934c2 100644 --- a/R/stats.R +++ b/R/stats.R @@ -3,7 +3,8 @@ stats <- new_environment(list(attempts = 0L, fallback = 0L, calls = character()) #' Show stats #' #' Prints statistics on how many calls were handled by DuckDB. -#' +#' The output shows the total number of requests in the current session, +#' split by fallbacks to dplyr and requests handled by duckdb. #' #' @return Called for its side effect. #' diff --git a/man/as_duckplyr_df.Rd b/man/as_duckplyr_df.Rd index 2edbcfb5..76e38289 100644 --- a/man/as_duckplyr_df.Rd +++ b/man/as_duckplyr_df.Rd @@ -16,7 +16,11 @@ An object of class \code{"duckplyr_df"}, inheriting from the classes of the \description{ For an object of class \code{duckplyr_df}, dplyr verbs such as \code{\link[=mutate]{mutate()}}, \code{\link[=select]{select()}} or \code{\link[=filter]{filter()}} will attempt to use DuckDB. -If this is not possible for whatever reason, the original dplyr implementation is used. +If this is not possible, the original dplyr implementation is used. +} +\details{ +Set the \code{DUCKPLYR_FALLBACK_INFO} and \code{DUCKPLYR_FORCE} environment variables +for more control over the behavior, see \link{config} for more details. } \examples{ tibble(a = 1:3) \%>\% diff --git a/man/config.Rd b/man/config.Rd index dffb20b2..fbcaa978 100644 --- a/man/config.Rd +++ b/man/config.Rd @@ -19,7 +19,7 @@ Currenty set to \code{TRUE} when duckplyr is loaded. \code{DUCKPLYR_OUTPUT_ORDER}: If \code{TRUE}, row output order is preserved. -If \code{FALSE}, +The default may change the row order where dplyr would keep it stable. \code{DUCKPLYR_FORCE}: If \code{TRUE}, fail if duckdb cannot handle a request. diff --git a/man/df_from_file.Rd b/man/df_from_file.Rd index 20d26a07..cb998870 100644 --- a/man/df_from_file.Rd +++ b/man/df_from_file.Rd @@ -51,7 +51,12 @@ names(df) df$a # Return as tibble: -df_from_file(path, "read_csv_auto", class = class(tibble())) +df_from_file( + path, + "read_csv", + options = list(delim = ",", auto_detect = TRUE), + class = class(tibble()) +) unlink(path) } diff --git a/man/stats_show.Rd b/man/stats_show.Rd index 579f4781..d9dbd92e 100644 --- a/man/stats_show.Rd +++ b/man/stats_show.Rd @@ -11,6 +11,8 @@ Called for its side effect. } \description{ Prints statistics on how many calls were handled by DuckDB. +The output shows the total number of requests in the current session, +split by fallbacks to dplyr and requests handled by duckdb. } \examples{ stats_show()