Julian Ricardo
@booolio.bsky.social
43 followers 450 following 29 posts
Data carpenter / carpinteiro de dados Climate & energy nerd Cat dad
Posts Media Videos Starter Packs
booolio.bsky.social
YMMV, but I am a faithful of the tidytable package for expressing things in a tidyverse style with data.table under the hood. Perhaps not all that different from the dtplyr suggestion here

markfairbanks.github.io/tidytable/
Tidy Interface to data.table
A tidy interface to data.table, giving users the speed of data.table while using tidyverse-like syntax.
markfairbanks.github.io
Reposted by Julian Ricardo
teunbrand.bsky.social
Hi folks! I know it is the weekend, but I'd like to quickly announance an update to {legendry} version 0.2.0:

teunbrand.github.io/teunbrand_bl...

#rstats #ggplot2
A scatterplot of the gapminder dataset, showing GDP per capita on the x-axis and life expectancy on the y-axis. The points are sized by population, which has a legend with overlapping circles. A correlation heatmap of the mtcars dataset. Car names on the left are decorated with a dendrogram. The bottom cells also have a dendrogram, whereas the labels are on the top.
booolio.bsky.social
anybody got cheat codes for finding #rstats jobs they're willing to share?
booolio.bsky.social
s/o to @acastroaraujo.bsky.social for sharing a recursive fn, which I really liked
bsky.app/profile/acas...
booolio.bsky.social
Day 5 of #AdventofCode went smoother for me than yesterday, but I struggled with part 2 until learning from others' solutions
Code in R solving Advent of Code day 5 part 1
booolio.bsky.social
why the calc_muls function? 🤷
Reposted by Julian Ricardo
noamross.net
Excited and grateful that R-Universe is R Consortium's newest top-level project! This means sustained support for @rOpenSci.hachyderm.io.ap.brid.gy's platform for discovery and publishing of #rstats packages. Hats off to @jeroenooms.bsky.social for his leadership!

ropensci.org/blog/2024/12...
R-Universe Named R Consortium Top-Level Project
We're excited to announce R-Universe has been named the R-Consortium's newest Top-Level Project.
ropensci.org
booolio.bsky.social
Day 2 of #AdventofCode stumped me for a while, but thankfully I was able to troubleshoot with others' solutions on here.

Moving right along, here's my attempt at day 3 #rstats
Code in R answering day 3 of advent of code
booolio.bsky.social
I used the collapse package to get my answer for day 1, part 2 #rstats #AdventofCode
Code in R to answer day 1 part 2 of the Advent of Code
booolio.bsky.social
I just completed "Historian Hysteria" - Day 1 - Advent of Code 2024 #AdventOfCode adventofcode.com/2024/day/1
booolio.bsky.social
Catching up on Advent of Code with my day 1 solution #rstats
Code in R to answer Day 1 of the Advent of Code 2024
Reposted by Julian Ricardo
josiahparry.com
I now dedicate the first 20+ lines of my user facing functions to argument validation.

I cannot emphasize how helpful this is for preventing bugs.

Read about r-lib standalone check: josiahparry.com/posts/2024-0...
#rstats
Screenshot of the following code 

arc_read <- function(
    url,
    col_names = TRUE,
    col_select = NULL,
    n_max = Inf,
    name_repair = "unique",
    crs = NULL,
    ...,
    fields = NULL,
    alias = c("drop", "label", "replace"),
    token = arc_token()
) {

  # argument validation
  check_string(url, allow_empty = FALSE)
  check_string(alias, allow_empty = FALSE)
  check_character(fields, allow_null = TRUE)
  check_character(col_select, allow_null = TRUE)

  is_valid_col_names_arg <- rlang::is_logical(col_names, 1) ||
    rlang::is_null(col_names) ||
    rlang::is_character(col_names)

  if (!is_valid_col_names_arg) {
    cli::cli_abort(
      "{.arg col_names} must be one of {.val TRUE}, {.val FALSE},\\
      {.val NULL}, or a character vector of the new column names"
    )
  }

  if (!rlang::is_integerish(n_max, 1)) {
    cli::cli_abort("{.arg n_max} must be a scalar integer.")
  }
booolio.bsky.social
giving this a try, but pal keeps prompting me for an anthropic API key after I save a fake one to my .Renviron. did you run into this too?
Reposted by Julian Ricardo
erictleung.bsky.social
just remembered this scales R package function that quickly makes your large dollar amounts into human friendly units, and it takes care of those changing units from say millions to billions #RStats

scales::label_dollar(scale_cut = cut_short_scale()

reference: scales.r-lib.org/reference/la...
Screenshot of a y-axis of a graph showing that large dollar amounts are shown in human friendly units, like five hundred million dollars and one billion dollars