by localhost · 10y ago · 0 comments
If you prefer Azure, a G5 instance with 448GB RAM is available for $9.65/hr.
Not a lot of need for Spark/SparkR for the vast majority of data sets given the cheapness of compute these days.
Such an approach worked to great effect for me recently, when I needed to perform a `zoo::rollapply`[3] across a time series with tens of millions of rows. The speedup when throwing more cores (7, on my laptop) at it is roughly linear. If I ever need to scale up the analysis to hundreds of millions of rows, the 128 vCPUs of an x1 EC2 instance would be well worth the $$/hour.
[1] https://cran.r-project.org/web/packages/foreach/index.html
[2] https://cran.r-project.org/web/packages/doFuture/index.html
https://gist.github.com/stillmatic/fadfd3269b900e1fd7ee
if your function has a well-defined rolling form, e.g. rolling mean or standard deviation, you should use a pre-optimized function for that. package `catools` has a bunch of useful ones.