Ref: https://rud.is/b/2022/12/19/2022-hanukkah-of-data-puzzle-1/ library(tidyverse) cust <- read_csv(“~/Downloads/noahs-csv/noahs-customers.csv”) orders_items <- read_csv(“~/Downloads/noahs-csv/noahs-orders_items.csv”) orders <- read_csv(“~/Downloads/noahs-csv/noahs-orders.csv”) products <- read_csv(“~/Downloads/noahs-csv/noahs-products.csv”) orders_items |> left_join(products) -> oip orders |> left_join(oip) -> orders orders |> filter( 2017 == lubridate::year(ordered), grepl(“cleaner|bagel”, desc, ignore.case=TRUE) ) |> group_by(customerid, orderid) |> summarise( ord = paste0(desc, collapse=”; “), n = n() ) |> arrange(desc(n)) # look for bagel… Continue reading
Post Category → R
2022 Hanukkah of Data • Puzzle 1
Visiting #2 and doing some $WORK-work, but intrigued with Hanukkah of Data since Puzzle 0 was solvable with a ZIP password cracker (the calendar date math seemed too trivial to bother with). Decided to fall back to R for this (vs Observable for the Advent of Code which I’ll dedicate time to finishing next week)…. Continue reading
Bootstrapping An {ojs} Quarto Document With An Observable Notebook
Quarto is amazing! And, it’s eating the world! OK. Perhaps not the entire world. But it’s still amazing! If you browse around the HQ, you’ll find many interesting notebooks. You may even have a few yourself! Wouldn’t it be great if you could just import an Observable notebook right into Quarto? Well, now you can…. Continue reading
Introducing {weatherkit}: The Eventual Replacement R Package for {darksky}
My {darksky} package has been around for years, now, and the service that powers it was purchased by Apple before the pandemic. The DarkSky API is slated to be shuttered in December of this year and is being replaced by Apple’s WeatherKit xOS Framework and REST API. I’ve started work on a {weatherkit} package which… Continue reading
Using Leonardo SVG Palettes in R
In today’s newsletter Leonardo, an open source project and free online too from Adobe that lets you make great and accessible color palettes for use in UX/UI design and data visualizations! You can read the one newsletter section to get a feel for Leonardo, then go play with it a bit. The app lets you… Continue reading
Rusty HTML Minifying In R with {rextendr}
In my M-F newsletter today I mentioned an awesome Rust-based HTML/JS/CSS minifier library that also include batteries for a few other languages. There was no R port, so I made one using {rextendr}. The {rextendr} package makes is as easy to use Rust code in R packages as {Rcpp} does C/C++ code. It was as… Continue reading
Keeping Those SSH Keys Safe
I came across a neat site that uses a Golang wasm function called from javascript on the page to help you see if your GitHub public SSH keys are “safe”. What does “safe” mean? This is what the function checks for (via that site): Recommended key sizes are as follows: For the RSA algorithm at… Continue reading
Update On ESC/POS Package Work
The morning before work was super productive and there is a nigh-complete DSL for ESC/POS commands along with the ability to just print {ggplot2}/{grid} object. I changed the package name to {escpos} since it is no longer just plot object focused, and the DSL looks a bit like this: library(stringi) library(hrbrthemes) library(ggplot2) library(escpos) ggplot() +… Continue reading