Lorenzo Gaborini
lgaborini.bsky.social
Lorenzo Gaborini
@lgaborini.bsky.social
Lausanne based 🇨🇭
- Senior Data Analyst @IntTestAgency
- PhD Forensic Science @unil
- MSc Mathematical Engineering @polimi

®🐍🏃‍♀️⛷🚲🥐🍽
Just explicitly call utils::data(), do not prefix yours
November 7, 2025 at 6:18 AM
I can move the .venv outside (UV_PROJECT_ENVIRONMENT) but this is not standard and not well recognized by Positron.
November 5, 2025 at 10:23 PM
uv is generally fine (new releases take a while to get whitelisted — same as Positron, ark, ...). But most other packages are dead: dbt, airflow, flask, csvkit, pip, sometimes Python. (Plus Onedrive doesn't support symlinks, the .venv gets actually filled by the library.)
November 5, 2025 at 10:23 PM
Still, Python ships lots of executables, and Windows Defender is not happy. So uv is still unusable since I can't add an exception for each project. And the maintainer refuses to use a centralized library: {renv} does it better!
November 5, 2025 at 2:06 PM
4. New argument labs(dictionary) to label based on variable name rather than based on aesthetic (@teunbrand, #5178)

AKA: more awesomeness just like scales::label_dictionary()!
github.com/tidyverse/gg...
Label dictionary by teunbrand · Pull Request #6077 · tidyverse/ggplot2
This PR aims to fix #5178. Briefly, it adds labs(dict) that allows one to use a data-dictionary to label a plot based on variable names (rather than aesthetics). Let's just jump into examples. ...
github.com
November 3, 2025 at 10:06 AM
3. New layer(layout) argument to interact with facets (@teunbrand, #3062)

AKA: repeat a layer in every facet without messing with data
github.com/tidyverse/gg...
Layer parameter controlling facet layout by teunbrand · Pull Request #6336 · tidyverse/ggplot2
This PR aims to (eventually) fix #3062. Briefly, it adds a layer(layout) argument to control how data is assigned to panels. Currently only layout = "fixed" is implemented, which repeats ...
github.com
November 3, 2025 at 10:06 AM
2. New stat: stat_manual() for arbitrary computations (@teunbrand, #3501)
github.com/tidyverse/gg...
Manual stat by teunbrand · Pull Request #6103 · tidyverse/ggplot2
This PR aims to fix #3501 and replaces #6066. It improves upon #6066 by simplifying the stat to stat_manual(fun = identity). It really is a thin wrapper to essentially offer a way for a user to pro...
github.com
November 3, 2025 at 10:06 AM
1. coord_*(expand) can now take a logical vector to control expansion at any side of the panel (top, right, bottom, left)
github.com/tidyverse/gg...
Repurpose coord expansion by teunbrand · Pull Request #6027 · tidyverse/ggplot2
This PR aims to fix #6020. Briefly, it allows expand to take a length-4 logical vector for each of the positions (top, right, bottom, left). Alternatively, one could use a named vector too. devtool...
github.com
November 3, 2025 at 10:06 AM
Luckily it's getting less and less necessary in R, empty arguments (trailing commas) are often supported within the tidyverse 🍻
And also in DuckDB SQL FYI
October 22, 2025 at 12:10 PM
Without leaving the tidyverse, just extract the numbers with readr::parse_number(), then use order() on the string:

Treatment <- c("Control", "Asprin 10mg/day", "Asprin 50mg/day", "Asprin 100mg/day", "Acetomycin 100mg/day" "Acetomycin 1000mg/day")

Treatment[order(readr::parse_number(Treatment))]
October 2, 2025 at 8:37 AM
ggplot2 and now plumber2! What a year! 🙌
September 24, 2025 at 12:53 PM
It is like saying that I know how to fix a faucet because I can call a plumber
September 22, 2025 at 7:51 AM
Another instance of the Norway problem!
September 22, 2025 at 7:23 AM
TIL! I've always used {tibble} enframe()/deframe()
September 8, 2025 at 8:16 AM
Microsoft Powertoys: calculator, fuzzy file search, OCR text extractor, advanced paste and SO MUCH MORE with a single keystroke from anywhere! 👌
September 5, 2025 at 7:00 AM
And then it's up to you to reflow anything since it's too difficult for them to open a text file. Not to mention when they require Track Changes.
August 27, 2025 at 7:30 AM
Pairs up nicely with the Norway problem!
August 26, 2025 at 4:19 PM
In princilple you can play around with the `cue` to avoid some of the invalidation causes. But I'm guilty too, I like to dump intermediate/cleaned results to csv and rds, even if I completely trust my pipeline. "You never know".
August 26, 2025 at 7:28 AM
One solution: fix the function environment of \() by making one on the spot. Modify the loop contents with:

list_vec[[i]] <- local({
i <- i
\() paste("vec is:", i)
})

Or manually::

e <- new.env()
e$i <- i
environment(list_vec[[i]]) <- e
list_vec[[i]] <- \() paste("vec is:", i)
August 22, 2025 at 9:32 AM
Proof:

rlang::fn_env(list_vec[[1]]) # <environment: R_GlobalEnv>
rlang::fn_env(list_vec[[2]]) # <environment: R_GlobalEnv>

list_vec[[1]]() # "bar"
list_vec[[2]]() # "bar"

i <- "other"
list_vec[[1]]() # "other"
August 22, 2025 at 7:26 AM