Hadley Wickham

Results 2577 comments of Hadley Wickham

Do you mind creating a reprex for me? The following code looks correct to me. ``` r library(rsconnect) dir [1] TRUE TRUE TRUE listDeploymentFiles(dir) #> [1] "a/b/z" "a/y" "x" writeLines("y",...

Or are you asking about this? ``` #' * You can exclude additional files by listing them in in a `.rscignore` #' file. This file must have one file or...

This is not technically supported, but it's a popular request, so I'll bite the bullet and implement it. See implementation in renv for a starting point: https://github.com/rstudio/renv/blob/main/R/renvignore.R. Looking forward, should...

Slightly simpler reprex: ``` r library(dbplyr) library(dplyr, warn.conflicts = FALSE) db slice_min(a, n = 2) #> # Source: SQL [?? x 1] #> # Database: sqlite 3.50.4 [:memory:] #> a...

Claude suggests `RANK() OVER (ORDER BY `a` NULLS LAST)` might work. Or for older databases, `RANK() OVER (ORDER BY CASE WHEN `a` IS NULL THEN 1 ELSE 0 END, `a`)`.

Note that `slice_min()` (and friends) relies on the translation of `min_rank()` which uses `win_rank()`. `min_rank()` doesn't have an argument to control whether or not `NA`s get ranks, so this will...

The problems actually a bit more complicated than I realised and I think also affects the direct translations of `min_rank()` etc. Unfortunately the ranking of `NULL`s is a rather inconsistent...

This is what's causing the issue: ``` r library(dbplyr) library(dplyr, warn.conflicts = FALSE) lf mutate(r = rank(), .order = a) #> #> SELECT "df".*, RANK() OVER () AS "r", "a"...