Publications by Michael Mayer

X-Mas Tree with 10 Lines of R Code

20.12.2021

Besides the many negative aspects of going through a pandemic, there are also certain positive ones like having time to write short blog posts like this. This one picks up a topic that was intensively discussed a couple of years ago on Wolfram’s page: Namely that the damped sine wave f(t) = t sin(t) can be used to draw a Christmas tree. Throw...

1107 sym R (519 sym/1 pcs) 2 img

Avoid loops in R! Really?

19.02.2022

It must have been around the year 2000, when I wrote my first snipped of SPLUS/R code. One thing I’ve learned back then: Loops are slow. Replace them with vectorized calculations orif vectorization is not possible, use sapply() et al. Since then, the R core team and the community has invested tons of time to improve R and also to make it faster...

2923 sym R (1693 sym/2 pcs) 8 img