Translations

Data types

duckplyr supports the following data types:

  • is.logical()
  • is.integer()
  • is.numeric()
  • is.character()
  • is.Date()
  • is.POSIXct() (with UTC time zone)
  • is.difftime()
duckplyr::duckdb_tibble(
  logical = TRUE,
  integer = 1L,
  numeric = 1.1,
  character = "a",
  Date = as.Date("2025-01-11"),
  POSIXct = as.POSIXct("2025-01-11 19:23:00", tz = "UTC"),
  difftime = as.difftime(1, units = "secs"),
) |>
  dplyr::compute()
#> # A duckplyr data frame: 7 variables
#>   logical integer numeric character Date       POSIXct             difftime
#>   <lgl>     <int>   <dbl> <chr>     <date>     <dttm>              <drtn>  
#> 1 TRUE          1     1.1 a         2025-01-11 2025-01-11 19:23:00 1 secs

Support for more data types, and passthrough of unknown data types, is planned. Let’s discuss any additional data types you would like to see supported.

Verbs

Not all dplyr verbs are implemented within duckplyr. For unsupported verbs, duckplyr automatically falls back to dplyr. See ?unsupported for a list of verbs for which duckplyr does not provide a method.

See the reference index for a list of verbs with corresponding duckplyr methods.

Let’s discuss any additional verbs you would like to see supported.

Functions within verbs

For all functions used in dplyr verbs, translations must be provided.

As of now, here are the translations provided:

  • Parentheses: ( (?Paren)

  • Comparison operators: ==, >, !=, <, >=, <= (?Comparison)

  • Basic arithmetics: +, /, -, * (?Arithmetic)

  • Math functions: log10(), log(), abs()

  • Logical operators: !, &, | (?Logic)

  • Branching and conversion: is.na(), dplyr::if_else(), as.integer(), strftime()

  • String manipulation: grepl(), substr(), sub(), gsub()

  • Date manipulation: lubridate::hour(), lubridate::minute(), lubridate::second(), lubridate::wday()

  • Aggregation

    • sum(), dplyr::n(), dplyr::n_distinct()
    • mean(), median(), sd()
    • min(), max()
    • any()
    • dplyr::first(), dplyr::last(), dplyr::nth()
  • Ranking

    • dplyr::row_number()
    • rank(), dplyr::min_rank(), dplyr::dense_rank()
    • dplyr::percent_rank(), dplyr::cume_dist()
    • dplyr::ntile()
  • Shifting: dplyr::lag(), dplyr::lead()

  • Special cases

    • $ (?Extract) is implemented if the LHS is .data or .env
    • %in% (?match) is implemented if the RHS is a constant with up to 100 values
    • dplyr::desc() is only implemented in the context of dplyr::arrange()
    • suppressWarnings() is a no-op

Refer to our contributing guide to learn how to contribute new translations.