8 ms·
As someone who writes R daily, I’m really excited for 4.0. That said, R still leaves a lot to be desired. Changing the default for stringsAsFactors is great, an
by bransonf 6y ago
As someone who writes R daily, I’m really excited for 4.0. That said, R still leaves a lot to be desired. Changing the default for stringsAsFactors is great, and I think it reflects a small shift in R from being an exclusively stats-based language to something more general purpose. The nature of stringsAsFactors is that in most statistical models you need your categorical variables to be ordinal.
That said, R still is a stats language by design. In Python or JS for example, you can concatenate strings with ‘a’ + ‘b’ but the + operator in R is explicitly only for numeric types. R also has a horrible architecture for memory management, leading to code that uses profound amounts of RAM. I face this issue constantly as I work with very large datasets.
I have a love/hate relationship with R and despise using it in production. I’m also not a fan of the divergence that Tidyverse has caused. Particularly the expectation of Non-standard evaluation and the tendency for new R learners to become dependent on these packages. Especially as it relates to reproducibility and deploying code, these unnecessary dependencies suck. Tidyverse is maturing and breaking changes are still too common for comfort. There is no reason in my opinion to load stringr when a grep() will suffice. Or, to subset with select when [[ works perfectly fine. Or to filter when subsetting on a logical with which()... the list goes on. Tidyverse is essentially reinventing the wheel in many places. The biggest problem is that it doesn’t translate well to base-R in my experience with new programmers, leading to this divergence.
That said, piping with %>% and modifying directly with %<>%(via magrittr) is a pleasure that other languages I’ve worked with don’t manage as well.
And at the end of the day, I’m not going to rewrite implementations of all the latest statistical methods already written in R, and this is its strong suit. I’m increasingly using sophisticated spatial and spatiotemporal methods, and these methods are solely implemented in R.
I understand that R gets a lot of flack from software developers and I understand why. But, I also think it’s too often overlooked for its strong suits.
- jrumbut 6y agoMaybe stringsAsFactors was a mistake in the original design, but there is so much code out there reliant on this behavior now and since it was the default you don't really know where the new behavorior will bite you besides looking for calls to data.frame that don't set the parameter. Plus, it's not such a bad feature when you know it's coming. As far as the tidyverse goes, I get it now however it seems to discourage the creation of a nice, well organized set of functions to limit the amount you need to keep in your head at the same time, and a lot of R users are very smart people capable of understanding very disorganized code. Instead of functions you get copy/pasted incantations, in Base R it's at least broken down into steps which is a start.