Press "Enter" to skip to content

Category: R

Support for Typst in knitr

Yihui Xie makes an announcement:

A few weeks ago I added preliminary support for Typst to knitr. The way it works is simple: if your file has the extension .Rtypknitr will recognize it as a Typst document, knit it, and produce a .typ output file. The chunk syntax follows the same Markdown-style fenced code block convention: ```{r} to start a chunk and ``` to end it, with inline R expressions written as `r expr`. A minimal example (hello.Rtyp):

Click through for that example, as well as some notes on Typst and HTML.

Leave a Comment

Maestro Now 1.1.0

Will Hipson lays out an update:

maestro has officially graduated to stable release with version 1.0.0 back in January 2026 and now its latest version 1.1.0. This marks a commitment to maintaining a stable API and increased reliance on using maestro in production. In our environment alone, maestro has orchestrated millions of pipeline executions over the course of a year, effectively making it the heartbeat of our entire data stack.

If you haven’t heard of maestro, it’s a pipeline orchestration package. You can learn more about it here.

Click through to see what’s changed between the 1.0.0 release and now. H/T R-Bloggers.

Leave a Comment

What’s New in R 4.6.0

Russ Hyde has a summary:

R 4.6.0 (“Because it was There”) is set for release on April 24th 2026. Here we summarise some of the more interesting changes that have been introduced. In previous blog posts, we have discussed the new features introduced in R 4.5.0 and earlier versions (see the links at the end of this post).

Once R 4.6.0 is released, the full changelog will be available at the r-release ‘NEWS’ page. If you want to keep up to date with developments in base R, have a look at the r-devel ‘NEWS’ page.

Click through for the highlights.

Leave a Comment

Diagnosing a textConnection() Slowdown in R

Yihui Xie looks into an issue:

Running quarto render on a document with that single chunk took 35 seconds. The equivalent rmarkdown::render() finished in under half a second. As a side note in the issue, the reporter pinged me that the same problem existed in litedownlitedown is independent of both Quarto and knitr; it executes R code through xfun::record(). That is where I started looking.

Click through for the discovery process, explanation, and fix.

Comments closed

Compressing Images in R

Yihui Xie announces a new package:

Last month, @bastistician opened an issue on the litedown repo pointing out that knitr has a hook_pngquant() function for compressing PNG plots from code chunks, but litedown lacks such a feature. He included a reasonable workaround—calling system2("pngquant", ...) with litedown::get_context("plot_files") in a chunk at the end of the vignette. It shrank his vignette from 80 KB to 54 KB, which is a 33% reduction. Not bad.

The catch, of course, is that it requires pngquant to be installed on the system. For R users, installing a system binary is more friction than it sounds: it is brew install pngquant on macOS, a separate package manager invocation on Linux, and hunting down a standalone executable on Windows. If you maintain a package that others will build, you are now asking all of them to do this—for every machine they use. By contrast, install.packages("tinyimg") works the same way everywhere, which is the kind of simplicity that makes a tool actually get used.

This is why I created tinyimg.

Read on for more details about how tinyimg works, how well it compresses, and how it integrates with litedown.

Comments closed

Sharing Data between Shiny Modules

Colin Fay explains an architecture:

Some people have recently been vocal about misuses of the "stratégie du petit r", a mechanism for sharing data across {shiny} modules that was detailed both in the Engineering Production-Grade Shiny Apps book and in an older post written in 2019 on this blog.
And yes, if you’re wondering, I did feel old when I realized this blog post is almost 7 years old now

I’m always happy to be proven wrong, to challenge the way I build software, and to become a better software engineer. But given that we weren’t contacted to discuss the ideas behind this strategy, I thought the moment was perfect to give y’all an update on the latest approaches I’ve been using to share data across {shiny} modules, along with some thoughts and comments on the "stratégie du petit r".

Click through to learn more about Shiny modules, the challenge of passing information between modules, and some high-level ideas of how to pass information between these modules without everything falling apart. H/T R-Bloggers.

Comments closed

Loading Multiple CSV Files in R

Stephen Royle has a set of challenges:

In a previous post, I described how to run a session to teach R to cell biologists. In this post we’ll look in a bit more detail at one of the steps: how to load data into R.

As a reminder, a typical analysis task in cell biology follows these steps:

  • do the experiment(s)
  • collect the data – e.g. microscopy images
  • analyse and get a plain text (csv) output – e.g. using Fiji
  • load the data into R
  • crunch some numbers and plot

Click through for some explanation, as well as a few exercises (and solutions) for people trying to learn the language. H/T R-Bloggers.

Comments closed