default image magick cache limits are too restrictive, resulting in the following errors:
Error in magick_image_animate(image, as.integer(delay), as.integer(loop), :
R: cache resources exhausted `/tmp/RtmpbuP1HC/Rplot1.png' @ error/cache.c/OpenPixelCache/4083
## installation
sudo apt-get update -y && sudo apt-get install -y libmagick++-dev imagemagick
## increase the resource limits for the image pixel cache
sudo sed -i 's/\(<policy[^>]*name="memory"[^>]*value="\)[^"]*/\12GiB/' /etc/ImageMagick-6/policy.xml
sudo sed -i 's/\(<policy[^>]*name="map"[^>]*value="\)[^"]*/\14GiB/' /etc/ImageMagick-6/policy.xml
sudo sed -i 's/\(<policy[^>]*name="disk"[^>]*value="\)[^"]*/\15GiB/' /etc/ImageMagick-6/policy.xml