Sign in

David Schoch

@schochastics.net
577 followers 136 following 32 posts

Data Scientist/DevOps Engineer at cynkra | #Rstats enthusiast mr.schochastics.net

PostsRepliesMedia
David Schoch @schochastics.net · 03/08/2026
The experimental graphical framework vellum knows where grobs land before they are actually drawn to a device. One interesting side effect is that one can actually lint graphics without drawing them! #Rstats 📦: github.com/r-vellum/vellum
R code that shows the linter implemented in vellum:
vl_scene(4, 2, dpi = 96, bg = "white") |>
  draw(text_grob(
    "n = 120",
    x = 0.1,
    y = 0.9,
    gp = vl_gpar(fontsize = 2.5),
    name = "n_label"
  )) |>
  draw(points_grob(2.4, 0.5, name = "stray_point")) |>
  draw(text_grob(
    "watermark",
    gp = vl_gpar(fontsize = 22, col = "#F2F2F2"),
    name = "watermark"
  )) |>
  vl_lint()
#> 3 lint findings (3 warnings):
#> ✖ [low_contrast] watermark: contrast 1.4:1 against its backdrop - below 3:1
#> ✖ [offscreen] stray_point: drawn entirely outside the page - check the
#>   coordinates or the scale
#> ✖ [tiny_text] n_label: 3.3 px tall - below the 7 px legibility floor
1121
David Schoch @schochastics.net · 13/07/2026
Added `mark_image()` to vellumplot to support images as marks. The immediate use case was to show how extraordinary predictable the World Cup semis were this year. #rstats #worldCup 📦 github.com/r-vellum/vel...
040
David Schoch @schochastics.net · 10/07/2026
A side project I've been working on is public now: vellumverse, an #Rstats graphics stack built on a Rust backend. vellum sits where grid does but renders in Rust. vellumplot is the grammar on top and vellumwidget turns any plot into an interactive widget. Feedback welcome ☺️ github.com/r-vellum
1437
David Schoch @schochastics.net · 10/06/2026
We are currently working on the igraph 3.0.0 release which will bring big changes to the #rstats package! One that just landed on GitHub is a new, modern printing method that uses cli 🙂 Check it out at github.com/igraph/rigraph
Comparison of printing methods in igraph. On the top the old style and on the bottom the new method using cli
1276
David Schoch @schochastics.net · 06/05/2026
Experimental #rstats package similar to asciicast to write terminal gifs. Check it out: https:// github.com/schochastics/vhsR
0132
David Schoch @schochastics.net · 05/08/2025
If you are in need of memorable/human readable uuids, may I suggest {{dexid}}, an #rstats package that creates ids from adjectives and pokemons? 😀
Output of dex_sentence function.
"Elegant shellder uses wrap greedily"             
"Well-documented golbat uses lovely kiss sedately"
"Old-fashioned gyarados uses disable cautiously"  
"Impressionable gastly uses lovely kiss scarily"  
"Tidy graveler uses amnesia questionably"         Output of dexid function
"heavenly_tangela"   "bite-sized_krabby" 
"frizzy_machamp"     "impeccable_diglett"
"firm_spearow"       "delightful_ditto"  
"complete_golem"     "weary_pidgeot"     
"winged_bellsprout"  "realistic_machop" Hex sticker of the R package dexid with showing a non existing pokemon that looks like a cross breed of charmander and eevee
1223
David Schoch @schochastics.net · 06/06/2025
We are currently developing a new interactive network viz package based on the JS engine G6. So many cool features to come! Checkout the current status on github github.com/cynkra/g6r #rstats
1232
David Schoch @schochastics.net · 29/04/2025
#Rstats hivemind: what is the correct way for a plumber API to read/write parquet files? I did not get `parser_parquet()` to work properly (and would rather have nanoparquet anyway) so this kind of works but I am unsure if thats ok 🙈
A simple plumber api that reads and writes parquet files:

# plumber.R
library(plumber)
library(nanoparquet) # To read Parquet files

#* @apiTitle Parquet File Upload API

#* Upload a Parquet file
#* @param req:file The request object
#* @post /upload_parquet
function(req) {
  # Access the uploaded file from the request
  multipart <- mime::parse_multipart(req)
  fp <- multipart$file$datapath
  data <- nanoparquet::read_parquet(fp)

  resp <- data.frame(
    status = "success",
    n_rows = nrow(data),
    n_cols = ncol(data),
    columns = names(data)
  )

  tmp <- tempfile(fileext = "parquet")
  nanoparquet::write_parquet(resp, tmp)
  on.exit(unlink(tmp))

  readBin(tmp, "raw", n = file.info(tmp)$size)
}
110
David Schoch @schochastics.net · 28/03/2025
New version of rchroma is now available! The #Rstats pkg wraps the API of ChromaDB, an open-source AI-native database that makes it easy to store, search, and retrieve vector embeddings alongside metadata. Perfect for building RAGs! It is now much easier to run the container and save db tables.
160
David Schoch @schochastics.net · 18/02/2025
Not sure if this already exist, but I created a #quartopub filter which adds a domain preview to each link in a quarto html document. Might come in handy for accessibility. 📦 github.com/schochastics... #rstats
screenshot of a document that contains links processed by url-peek
052
David Schoch @schochastics.net · 13/02/2025
@christophsax.bsky.social and I wrote an #rstats package for ChromaDB which is now available on CRAN🎉🎉🎉 ChromaDB is an open-source vector database designed for efficient similarity search—great for working with LLM applications like RAGs! 📦 github.com/cynkra/rchro...
Hex sticker of the R package rchroma showing a stylized icon of a database in chroma colors
082
David Schoch @schochastics.net · 12/02/2025
Here is the result of one of my last academic endeavors: Paperwizard, an #rstats package to extract readable content (such as news articles) from webpages using Readability.js 📦 github.com/schochastics... 📝 blog.schochastics.net/posts/2025-0...
Hex logo of the R package paperwizard showing a pixely wizard holding a newspaper
13014
David Schoch @schochastics.net · 01/01/2025
New Year, new career. Yesterday was my last day as an academic. Now it is time for the "Real World".
Screenshot of my profile with new job title: Data Scientist/DevOps Engineer at cynkra
270
David Schoch @schochastics.net · 09/12/2024
Last year December I created my first #QuartoPub dashboard for a "GitHub Wrapped". Still works like a charm 😁 #rstats github.com/schochastics...
A dashboard showing stats on my GitHub usage in 2024
Total Contributions: 1155
Repositories created: 37
Issues opened: 66
Pull requests: 36
Stargazed: 22

longest streak:79 days
longest gap: 6 days
active days: 239

Weekday: most contributions where made on a Monday (least on Saturday).
Months: Most contributions were made in February (least in May)
030
David Schoch @schochastics.net · 08/12/2024
#AdventofCode Day 07 in #Rstats Yes this was again solvable with eval parse. Was that efficient? hell no! but doing left to right execution by inserting parentheses in a string is a 9000IQ move, I'd say
code can be found here: https://github.com/schochastics/adventofcode/blob/main/2024/day07.R
071
David Schoch @schochastics.net · 04/12/2024
#AdventofCode Day 04 in #Rstats
Rstats solution for Advent of code day 4. Code can be found here: https://github.com/schochastics/adventofcode/blob/main/2024/day04.R
040
David Schoch @schochastics.net · 03/12/2024
Starting #AdventOfCode on Day 03 with #RStats 🙂 I think it took me like a second to scream EVAL PARSE!!! One of my favorite concepts in R 😆 (my solutions can be found here: github.com/schochastics...)
AdventOfCode Day 03 Solution with RStats
input <- paste0(readLines("input03.txt"), collapse = "")
mul <- `*`

mul_str <- unlist(stringr::str_extract_all(input, "mul\\([0-9]+,[0-9]+\\)"))
sum(vapply(mul_str, \(x) eval(parse(text = x)), numeric(1)))

input <- paste0("do()", input, "don't()")
matches <- paste0(stringr::str_extract_all(input, "(?<=do\\(\\))(.*?)(?=don't\\(\\))")[[1]], collapse = "")
mul_str <- unlist(stringr::str_extract_all(matches, "mul\\([0-9]+,[0-9]+\\)"))
sum(vapply(mul_str, \(x) eval(parse(text = x)), numeric(1)))
130
David Schoch @schochastics.net · 18/11/2024
I tried to get a hang gt for so long and now I finally sat down and did it. It always felt cumbersome to me but I have to say it is quite easy to use once you get into it #Rstats 📜 writeup blog.schochastics.net/posts/2024-1...
The Bundeslig League table after 10 games with a retro look created with the R package gt
030
David Schoch @schochastics.net · 29/10/2024
Hello #rstats, giving this side another try🤗. To kick it off, here is a great fashion item. A t shirt made out of more than 2000 hexstickers 😅 here is the making of and how you can make one yourself: blog.schochastics.net/posts/2024-1...
2516