David Schoch

@schochastics.net

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

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

BildBildBildBild

#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)
}

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.

Bild