Davis Vaughan
@davisvaughan.bsky.social
2.8K followers 210 following 150 posts
Building tools for R users, these days mostly in Rust 🦀 https://blog.davisvaughan.com https://github.com/DavisVaughan
Posts Media Videos Starter Packs
davisvaughan.bsky.social
It is not internal! It is something I've been iterating on to help with performance based PRs in vctrs and elsewhere. I have gotten enough questions about it that I should probably release it for real at some point, but feel free to use it github.com/DavisVaughan...
GitHub - DavisVaughan/cross: Run Functions Across Package Versions
Run Functions Across Package Versions. Contribute to DavisVaughan/cross development by creating an account on GitHub.
github.com
Reposted by Davis Vaughan
mattansb.msbstats.info
We all know filter, mutate, summarize, but the #tidyverse has some advanced hidden jems!

Recently a client sent me some code they were using to look up values between 2 tables based on date-times.

I replaced ~100 lines of code* with a single inner_join(by = join_by(overlap())).
andrew.heiss.phd
I just learned about the `truncate` argument in {lubridate} functions, which means NO MORE HACKY paste0(year, "-01-01") code to build dates when converting years to dates in #rstats
library(lubridate)

yr <- 2025

# This doesn't work
ymd(yr)
#> Warning message:
#> All formats failed to parse. No formats found. 
#> [1] NA

#-------
# TIRED
#-------
# I've done this for *yeeeeears*
ymd(paste0(yr, "-01-01"))
#> [1] "2025-01-01"

#-------
# WIRED
#-------
# The truncated argument tells {lubridate} that it can 
# ignore up to 2 (in this case) formats to look for. 
# Ordinarily `ymd()` looks for three formats: a year, 
# a month, and a day. `truncated = 2` means it can skip 
# the month and day parts
ymd(yr, truncated = 2)
#> [1] "2025-01-01"

ymd(c("2025", "2025-10", "2025-10-02"), truncated = 2)
#> [1] "2025-01-01" "2025-10-01" "2025-10-02"
davisvaughan.bsky.social
Getting inequality/rolling/overlap joins in dplyr is definitely one of my proudest accomplishments 😆 Glad it was useful!
davisvaughan.bsky.social
2️⃣ I ALSO HAVE STRONG FEELINGS ABOUT THIS
davisvaughan.bsky.social
So good to see you!! (And your family 😂)
Reposted by Davis Vaughan
lucystats.bsky.social
Another delightful #positconf in the books! So lovely to see everyone 🌻 I miss it already!

Especially excited about:
🤖 @minecr.bsky.social’s aifeedr
🌬️ Making my code pretty like @davisvaughan.bsky.social’s with air
@emilhvitfeldt.bsky.social’s editable quarto magic
📈 everything @kjhealy.co said
davisvaughan.bsky.social
We actually tried so hard to get baristas for conf itself, but the hotel policy about bringing in third party vendors is so strict! Luckily that does not apply for dev day 😬
davisvaughan.bsky.social
Time for tidyverse dev day!

Can’t wait to review some PRs and drink some coffee ☕️ #positconf2025
A menu of tidyverse themed coffee drinks
Reposted by Davis Vaughan
viniciusoike.bsky.social
I've been using Air since switching to Positron and have been loving it. My only criticism is the styling of tibbles (it just breaks them). Apparently that has been solved

# fmt: tabular

coming soon

#PositConf
davisvaughan.bsky.social
Confirmed to be a bug, sorry about that
davisvaughan.bsky.social
We’ve actually secretly taken over the air R package too and may use it later on as well!
davisvaughan.bsky.social
It’s actually a Rust crate not an R package! But we are indeed very excited about the upcoming tabular formatting!
davisvaughan.bsky.social
Air is our incredibly fast R code formatter!

Come learn all about it at 2:40pm in Regency V in the Sparking Development Joy session!!

We also have hex stickers!

#positconf2025 #rstats
Air hex sticker logo
davisvaughan.bsky.social
Because it's just a markdown document, I had the idea that maybe you can tell an AI about the extrachecks list and have it analyze your project for you. It's not a guaranteed success, but it's probably a reasonable first pass? I'd still personally double check everything manually too.
Reposted by Davis Vaughan
davisvaughan.bsky.social
Regardless of all of that, we'd definitely like people to try it out - particularly with dev purrr and dev carrier as that fixes a number of things that @shikokuchuo.net improved on.
davisvaughan.bsky.social
I think it's fine to use furrr if you want. Note purrr won't auto collect globals, and I think purrr's behavior is probably better, but it could make converting feel frustrating. future also has a whole host of backends that are supported. We are also still shaking out a few bugs on the purrr side.
davisvaughan.bsky.social
did a somewhat heavy deadlift a few weeks ago and tweaked my back so badly i couldn't lift the toilet seat the next morning