5 ms·
What makes R a dated and quirky language? I know a reasonable amount of R, but I don't really know any other programming language. I did once go looking at Jul
by phillc73 10y ago
What makes R a dated and quirky language?
I know a reasonable amount of R, but I don't really know any other programming language. I did once go looking at Julia, and had thought to write a few simple things using it, but in the end just ran out of time and did it with R.
Learning R has been one of the most challenging and enjoyable things I've done over the last three years. However, I would be interested to know where Python, Go or Julia would make my life better or easier.
I mostly write R scripts to analyse and graphically display interpretations of data. There are so many contributed libraries, it feels like I am really spoiled for choice.
I also write Shiny web apps. Is there a Python equivalent of Shiny? I have heard of Django, but is that really as easy as just writing a Python script and deploying on a server? I always thought Django was more of a complete framework which also required server side coding.
Anyway, I would genuinely like to know what advantage Python or Julia or Go would provide me with over just continuing with R.
- RockyMcNuts 10y agoJulia claims performance closer to Fortran or C, with the expressiveness of a high-level scripting language. It seems to have enough traction that it's probably the way of the future. R quirks ... the <- syntax, the ~ formula syntax, looping through a dataframe is horrifically slow when you can't vectorize, multiple legacy object semantics, poor parallel/multiprocessing support, poor support for datasets that don't fit in memory ... upside is any statistical method probably has a decent implementation in R python - most comprehensive ecosystem and libraries beyond statistics, e.g. Web, numerical and scientific computing, machine learning (Tensorflow), NLP, generally a good language to learn to program in, pretty easy and forgiving while also being reasonably expressive, performant, offering functional as well as object oriented features/styles. the good folks at plotly are working on a shiny equivalent (dash) but it's not out yet. Django + matplotlib or bokeh or some client-side graphics like plotly.js is potentially powerful but not really as integrated as shiny.
- kprybol 10y agoJulia's biggest hurdle is the lack of well functioning DataFrames (or the current fork, DataTables). Tons of issues around nullable arrays, etc. have really slowed progress. I do think it's got a ton of upside, but I've found that reimplementing my R or Python scripts in Julia to be too much of a hassle. Costs of reimplemention greatly outweigh the not insignificant gains in speed. Also check out this article on updates to R 3.4. R tends to be fast enough for most work (I use it regularly on one-off analysis or things that won't ever make it farther than ad-hoc reporting/findings but can't imagine using it in production systems). The listed changes should go a long way towards making R just fast(er) enough for dealing with larger datasets (doesn't help with datasets larger than memory though). For large datasets all the momentum seems to be moving towards Spark (sparklyr is RStudio's SparkR integration. Very much a beta but getting better by the day). On the Python front Dask is awesome for out of memory computation that has no equivalent in R.
- mindcrime 10y agoFor large datasets all the momentum seems to be moving towards Spark (sparklyr is RStudio's SparkR integration. Worst case, you can always use MPI with R and run on a Beowulf cluster. Of course that might not help if you want to use a function from a library, and the library itself expects everything to be in memory on one node, but at least it gives you another option for parallelization.
- kprybol 10y agoAbsolutely, though as you mention, removing the ability to use packages and the necessity of writing statistical code that properly accounts for data being spread out across multiple nodes would likely be out of the reach of your everyday/typical R user. An open sourced alternative to Revolution R/Microsoft R Server's out of core processing backend + distributed analtyics packages would be a huge addition to the R language.
- kprybol 10y agoRealized I never posted the link about R 3.4 that I referenced. https://cdn.ampproject.org/c/s/www.r-bloggers.com/performance-improvements-coming-to-r-3-4-0/amp/ https://cdn.ampproject.org/c/s/www.r-bloggers.com/performanc...
- phillc73 10y agoI guess I never found the <- syntax odd, because that's all I know. Not using = for assignment kind of makes sense to me, as equals has mathematical connotations. I always thought there were plenty of options for parallel and high(er) performance computing with R.[1] Data sets which don't entirely fit in memory can be stored pretty much anywhere and queried. Simplest would be an SQLite database. Formats like Feather[2] and fst[3] are also really useful. There are multiple R interfaces for Redis.[4] R has a library to interact with the Tensorflow API[5] and many other machine learning services. "Multiple legacy object semantics" doesn't really mean a lot to me. Knowing nothing else, that's just the way R is, plus I don't think there are that many really strange ways of doing things. Mostly there's a discernable pattern across functions. Sounding like a fanboy sure, but as I said I just don't know anything else and while Julia sounds nice (speed, way of the future etc) it doesn't have the breadth of library support, stability or community that R does yet and I don't see a compelling reason for me personally to spend time learning Python. Not saying R is best to the exclusion of all else, but for data analysis, generalised scripting and some web based reports/reactive apps, I can't find a compelling reason to switch, and I guess don't really understand the criticism of the language. [1] https://cran.r-project.org/web/views/HighPerformanceComputing.html https://cran.r-project.org/web/views/HighPerformanceComputin... [2] https://github.com/wesm/feather https://github.com/wesm/feather [3] https://github.com/fstpackage/fst https://github.com/fstpackage/fst [4] https://github.com/antirez/redis-doc/pull/798/files https://github.com/antirez/redis-doc/pull/798/files [5] https://github.com/rstudio/tensorflow/blob/master/README.md https://github.com/rstudio/tensorflow/blob/master/README.md
- haihaibye 10y ago>> that's all I know >> I can't find a compelling reason to switch See The Blub paradox: http://www.paulgraham.com/avg.html http://www.paulgraham.com/avg.html You should learn a few languages even if you don't need them, just for the mind expansion and learning what is necessary and what is your culture's conventions. It's like travelling to a different country, beware the patriot who has never left his home country!
- RockyMcNuts 10y agoIf you like it and it does what you need, that's great! If/when you learn python, you'll get it. Python is expressive, readable, structured in a way R isn't...Shiny is all right but no one in their right mind would build a large general purpose web app in R.
- chris_7 10y agoI mean, there's about 10 slightly-different versions of `map` (whither `zip`, though?). There's several different mutually-incompatible object systems. It doesn't come with a proper dictionary or set. Multidimensional arrays (well, lists) are treated specially for some reason instead of just being a property that arises from the concept of an indexed container. It's definitely a weird language.