Code bits
Here I provide various code bits that I wrote for fun or for learning some aspects. It’s here for you if you are interested:
-
2D Gaussian fits: a colleague coming from Matlab wanted to be able to fit 2D Gaussians from Raman mappings. It’s actually not too hard with
nls()
and a tidytibble
. The only thing is that the initial guess of peaks positions needs to be not very far from the actual peaks positions – you can either provide it by hand or make an automatic peak finder. -
Fractals: I played around with the Mandelbrot set to make fractals, and compared a full-R code to a code using
Rcpp
(it was for me the occasion of my first code usingRcpp
)…Rcpp
wins (largely!) in terms of speed here! And it makes for suuuuuper nice images, too. I got inspiration from a R-bloggers post.