The cost of evaluating an expression instead of using the language directly

In a recent blog post I used something like this (for use in a call to optim()): obj_fun_expr <- expression((x^4 + 4 * x^2 * y^2 - 12 * x^2 * a + 144 * x^2 - 48 * x * y * a + 144 * x * y - 4320 * x + 36 * y^2 - 2160 * y + 180 * a^2 + 32400)/16) f_expr <- function(par) { x <- par[1] y <- par[2] a <- par[3] val <- eval(obj_fun_expr, list(x = x, y = y, a = a)) return(val) } I have been wondering what the cost of eval(expr, .

Automatic 'testthat' test skeletons with new R package 'roxytest' extending 'roxygen2'

It is important to test software. One approach is unit-testing, and for R packages this can e.g. be done using testthat. It is also important to document software. For R packages roxygen2 is really helpful: It enables you to write documentation in the code file in the R/ folder where the function is implemented. And then roxygen2 takes care of handling the Rd files in the man/ folder. I have made a new R package that combines these approaches: roxytest.

How much pizza and how much frozen yogurt?

As you may know, I am maintaining the Ryacas package (with online documentation) for doing symbolic mathematics (and other stuff) in R using the yacas software (with online documentation). Søren Højsgaard and I have been preparing a new major release of Ryacas (see blog post on it). We are now trying to show how to use it. To use the version, please install the development version as described at https://github.

Piano chords in R with the R package 'pichor'

I am learning how to play piano. In that process, I needed charts with piano chords. I know it is good practise to construct the chords manually, figure out the inversions and so on, but I found that some aspects of learning were improved with a chord chart. I searched the (entire!) internet, and struggled to find good, customisable charts. Thus I had to make something myself: pichor, an R package for making and working with piano chords in R.

Major update of Ryacas (R Interface to the Yacas Computer Algebra System)

We (Søren Højsgaard and I) are preparing a new major release of Ryacas (GitHub). It will have a new interface to yacas that is thinner, cleaner and more robust. It relies on yacas’s RForm() function rather than an OpenMath XML interface. It also means that the API has changed in Ryacas: new functions are introduced and old ones deprecated. Before showing the new API, let us first mention that a legacy version of Ryacas is available at GitHub.