by chuckcode · 11y ago · 0 comments
- pass by value only means code tends to end up as monolithic functions
- very slow in loops so lot contorting to move things to matrix operations
- they just last year got a version out that starts support for vectors and matrices with > 2^31 -1 elements which limits larger data applications.
I find the plotting with ggplot and statistical functionality to be second to none though.
I've actually found R works very well as a functional language with very lean functions. It's perhaps worth noting that R doesn't copy a dataframe in a function call if you don't modify it, which is a very common use-case for me. (I'm not sure if this extends to other datatypes)
> very slow in loops so lot contorting to move things to matrix operations
This is a fair criticism, I think more modern languages like Julia will win out here. That said, R has huge library support, I've often found there are compiled versions for a lot of what I want to do.
> they just last year got a version out that starts support for vectors and matrices with > 2^31 -1 elements which limits larger data applications
Again, a fair criticism. I've never considered R a "big data" tool, my workflow is usually a funnel where each step involves reducing data size by 1-3 orders of magnitude. For example, I may have 1 PB of transactional data, aggregate it in Hadoop to 20 TB of daily aggregated data, run a query that filters and aggregates it further, and then run my analysis in R on final data. In the end I may end up with 20 GB of data, which R can very easily handle.
Also note that loops are slow enough that it is really worth learning the *apply() functions in R to avoid iterating over collections. For a relatively in depth explanation check out Hadley Wickham's book http://adv-r.had.co.nz/Functionals.html
[1] http://stackoverflow.com/questions/2275896/is-rs-apply-famil...
Yes, but aren't they native loops underneath? I've seen it said both ways, that * apply is faster than R loops and that *apply isn't faster than R loops. Would be nice if someone could definitively answer the question and back it up with some stats! :)
EDIT: Thanks chuckcode, sibling post to this, I stand corrected :)
As a Python user, who resorts to R in case of need, the power of R is not in the language, but statistical community & packages.