Publications by markheckmann

Progress bars in R (part II) – a wrapper for apply functions

10.01.2010

In a previous post I gave some examples of how to make a progress bar in R. In the examples the bars were created within loops. Very often though I have situations where I would like have a progress bar when using apply(). The plyr package provides several apply-like functions also including progress bars, so one could have a look here and use a ...

1580 sym R (2774 sym/2 pcs) 6 img

Animate .gif images in R / ImageMagick

21.11.2010

Yesterday I surfed the web looking for 3D wireframe examples to explain linear models in class. I stumbled across this site where animated 3D wireframe plots are outputted by SAS.  Below I did something similar in R. This post shows the few steps of how to create an animated .gif file using R and ImageMagick. Here I assume that you have ImageMag...

2906 sym R (2304 sym/5 pcs) 14 img

Using R, Sweave and Latex to integrate animations into PDFs

18.04.2011

The first week of April I attended an excellent workshop on biplots held by Michael Greenacre and Oleg Nenadić at the Gesis Institute in Cologne, Germany. Throughout his presentations, Michael used animations to visualize the concepts he was explaining. He also included  animations in some of his papers. This inspired me to do this post in whic...

2693 sym R (3232 sym/6 pcs) 6 img

multi-platform real-time ‘intro’ in R using rdyncall

29.07.2011

Guest post by Daniel Adler. Below is a real-time audio-visual multimedia demonstration – or in short ‘an intro’ – written in 100% pure R. It requires no compilation and runs across major platforms via the package rdyncall and preinstalled precompiled standard libraries such as OpenGL and SDL libraries. This ‘happy-birthday’ production...

2723 sym 6 img

Useful R snippets

18.03.2012

(photo credit) In this post we collect several R one- or few-liners that we consider useful. As our minds tend to forget these little fragments we jot them down here so we will find them again. Indexing in nested loops Every once in a while I run a nested loop like the following one. for (i in 1:3) for (j in 1:4) print(paste(i, j)) Now...

2251 sym R (446 sym/9 pcs) 18 img

Creating a text grob that automatically adjusts to viewport size

01.08.2012

I recently wanted to construe a dashboard widget that contains some text and other elements using the grid graphics system. The size available for the widget will vary. When the sizes for the elements of the grobs in the widget are specified as Normalised Parent Coordinates the size adjustments happen automatically. Text does not automatically...

3359 sym R (989 sym/7 pcs) 14 img

Sending data from client to server and back using shiny

20.11.2013

After some time of using shiny I got to the point where I needed to send some arbitrary data from the client to the server, process it with R and return some other data to the client. As a client/server programming newbie this was a challenge for me as I did not want to dive too deep into the world of web programming. I wanted to get the job done...

7334 sym R (2241 sym/10 pcs) 8 img

Using colorized PNG pictograms in R base plots

12.09.2014

Today I stumbled across a figure in an explanation on multiple factor analysis which contained pictograms. Figure 1 from Abdi & Valentin (2007), p. 8. I wanted to reproduce a similar figure in R using pictograms and additionally color them e.g. by group membership . I have almost no knowledge about image processing, so I tried out several method...

3341 sym R (6000 sym/13 pcs) 26 img

QQ-plots in R vs. SPSS – A look at the differences

15.12.2014

We teach two software packages, R and SPSS, in Quantitative Methods 101 for psychology freshman at Bremen University (Germany). Sometimes confusion arises, when the software packages produce different results. This may be due to specifics in the implemention of a method or, as in most cases, to different default settings. One of these situations ...

7486 sym R (1926 sym/8 pcs) 40 img

Beautiful plots while simulating loss in two-part procrustes problem

14.04.2015

Today I was working on a two-part procrustes problem and wanted to find out why my minimization algorithm sometimes does not converge properly or renders unexpected results. The loss function to be minimized is with denoting the Frobenius norm, is an unknown scalar and an unknown rotation matrix, i.e. . , and are four real valued matrices. T...

2166 sym R (1106 sym/1 pcs) 64 img