33 ms·
R 4.0
- teruakohatu 7y agoNot a whole lot is new. Highlights (from my perspective) : * matrices are now a subclass of arrays. * better reference counting to save on memory. * stringsAsFactors = FALSE is now default breaking a lot of packages (was this really worth changing?) * a new way of defining raw strings: r"(...)" * better default colors for plots. The new default color scheme is less saturated. Apart from looking better, in the old scheme something plotted in bright yellow on a white background was hard to read. Yellow is now more of a mustard.
- _Wintermute 7y ago> stringsAsFactors = FALSE is now default breaking a lot of packages I know this is popular on the surface, but it's going to break so many "reproducible" analyses from manuscripts and scientific studies.
- KKPMW 7y agoThere is a global option controlling this. So if anyones analysis is broken, they can still set options(stringsAsFactors=TRUE). Furthermore the functions that are inherently about factors (like expand.grid and as.data.frame.table) still use stringsAsFactors=TRUE.
- SifJar 7y ago> So if anyones analysis is broken, they can still set options(stringsAsFactors=TRUE). But what are the chances that someone stumbling upon supposedly reproducible analysis happens to know that in R >4.0.0 they need to do this? Especially if the original analysis didn't even specify that it was originally run on R <4.0.0
- einpoklum 7y agoThere's a good chance they'll assume they need an R version from when the analysis was published, or to enable some sort of "old version compatibility mode" (does R have that?)
- hugh-avherald 7y agoBut it's a major version change and that's what major version changes are for.
- kachnuv_ocasek 7y agoReproducibles should be tied to specific versions of software or even OS and hardware. So no, this is not going to break correctly designed analyses. It's only going to break those which were not reproducible in the first place.
- _Wintermute 7y agoHence the quotation marks, the state of software engineering in many scientific fields isn't very good, you'll be lucky if people list which package versions they used.
- kachnuv_ocasek 7y agoFair enough. I might have misunderstood your remark originally, though the point stands, of course.
- deleted 7y ago[deleted]
- s1t5 7y ago* stringsAsFactors = FALSE is now default breaking a lot of packages (was this really worth changing?) Definitely worth it. Not sure how many packages it will break and whether it would count as breaking at all.
- nathell 7y agoFinally! I always forget to add it, and it inevitably causes frustration.
- jabl 7y ago> * stringsAsFactors = FALSE is now default breaking a lot of packages (was this really worth changing?) In my experience, both when I learned R myself back in the day, and teaching others to use it, this is something that trips up newbies over and over again. So from that perspective changing it is good. OTOH, a lot of existing code will need updating. Oh well..
- wodenokoto 7y agoWhat’s the benefit of the matrix change? I’ve never really worked with matrix types in R. What can I do in R4, that I couldn’t in R3? What mistakes will I avoid doing now that matrices are a subclass of arrays?
- bitcharmer 7y agoKudos to all contributors. Learning R and using it was a lot of fun and really satisfying experience. Great option for someone like me, who has to do some basic analysis of large data sets without rich statistical background.
- flashyfaffe2 7y agoDid you learn R for your own fun or just to upgrade your skill set and get a job?
- mirekrusin 7y ago...better set of options: 1. for fun 2. get a job or job done 3. all of above
- bitcharmer 7y agoIn my case it was Q vs R. For what I was trying to achieve and with my level of statistics background R was an obvious choice. The language/runtime AND RStudio are entirely free. Give it a try!
- ryndbfsrw 7y agokdb+ is the only tool I've come across that solidly managed to outperform data.table for data processing. I have huge respect for good Q programmers
- bitcharmer 7y agoLikewise. A good kdb dev is a very rare and intelligent beast, hats off. I'm just too stupid to be able to comprehend much of Kx's ideas and so R was just much more appealing to me.
- anonu 7y agoIn my experience even bad Q programmers can outperform. The language and underlying engine is pretty efficient...
- roenxi 7y agoThe breaking changes are all quite severe, I hope there is real demand for the features they are bringing in. Even if they don't agree with the direction Wickham's Tidyverse is going it showcased how flexible the R language was to being rewritten from the inside. Hadley effectively pulled of a more significant language upgrade with less breakages - the R core team could learn something from him here. Even their sensible na.rm default for new functions is introducing more weird inconsistencies to R.
- teruakohatu 7y agoAt this point Wickham is almost developing a parallel language that happens to be backwards compatible.
- rankam 7y agoHas the R core team publicly stated that they disagree with direction Wickham's Tidyverse is going? Genuinely asking as I love the Tidyverse, but would be interested to hear arguments against it.
- KKPMW 7y agoI am not sure why the original commenter said that tidyverse is more backwards-compatible compared with R core. It used to introduce breaking changes every 6 months or so. Also they like it this way and promote it: https://twitter.com/hadleywickham/status/1175388442802479104 https://twitter.com/hadleywickham/status/1175388442802479104
- disgruntledphd2 7y agoThey still do. I like the tidyverse, but Hadley's struggles with lazy evaluation and arguments has cost me lots and lots of time updating internal code at various workplaces. Don't get me wrong, the tidyverse is great, but if I was writing R code that I expected to run without supervision for a long time, I'd avoid it as much as possible.
- 7y ago
- rwmj 7y agoPlease start release announcements by saying briefly what it is! "R is a programming language for statistical analysis" or whatever. Don't assume that people are familiar with every possible piece of software already. Also pull important stuff to the top of announcement. Were there security issues that need you to upgrade? What are the major new features that would encourage you to upgrade? For example here's a release announcement I wrote recently: https://www.redhat.com/archives/libguestfs/2020-February/msg00287.html https://www.redhat.com/archives/libguestfs/2020-February/msg... Free software doesn't usually have an advertising budget, so you have educate people on what your software does at every opportunity you get.
- timthorn 7y agoTo be fair, the announcement was posted to the R-announce mailing list, and it seems probable that subscribers would know what R is.
- zhdc1 7y agoThis alone is reason to upgrade -> "R now uses a stringsAsFactors = FALSE default, and hence by default no longer converts strings to factors in calls to data.frame() and read.table()."
- FiReaNG3L 7y agoOne of the big reasons why I quit R 10 years ago and never looked back - Python wasn't secretely converting anything, AND failing silently when its not the expected type.
- kyllo 7y agoR's come a long way in the last decade. The tibble and data.table packages both address this issue. data.table (https://github.com/Rdatatable/data.table https://github.com/Rdatatable/data.table) is the more strongly-typed of the two, by default it fails loudly when it encounters data that doesn't conform to the column type. It's also quite fast--binds to C code that parallelizes with OpenMP. It has very terse and expressive syntax, I find it so much more intuitive and easy to work with than pandas. If you're happy with Python, by all means keep using it. I use both languages. Just suggesting that if you gave up on R that long ago, you might be pleasantly surprised by how much better it's gotten since then.
- Tarq0n 7y agovctrs [0] is the latest effort by the Rstudio developers to help people write type-stable code. The R standard library has a lot of issues with silently casting types, but the wonderful thing about it being so scheme-like is that many of these things can be evolved through libraries. [0] https://github.com/r-lib/vctrs https://github.com/r-lib/vctrs
- closed 7y agoBy python, are you also including pandas? Because it is definitely doing a lot of that!
- 6y ago
- mikevm 7y agoR is the quirkiest hard-to-remember programming language I have ever tried learning.
- williesleg 7y agoMultithreading yet? Helllloooooooo, it's not 1995 anymore.....
- AuthorizedCust 7y agoI teach a data science graduate course to non-tech majors, and it's mostly on R. I welcome these changes. I teach base R first for a few weeks, then I teach the TidyVerse as I introduce data science concepts, like text mining. I convey the TidyVerse as like an overlay on R, improving shortcomings and adding great functionality, syntactic sugar, etc. This context switch is jarring to some students. It's great to see some of the TidyVerse's strengths--part of the tibble--be moved back into base R. Now pardon me: I need to go. I start teaching dplyr in 51 minutes!
- ianbooker 7y agoThanks for sharing. I do exactly the same, and I always find it hard to justify base-R in front of my students, after they learn about the Tidyverse ;)
- deleted 7y ago[deleted]
- acomjean 7y agoThanks too. I had not heard of the "TidyVerse". The TidyVerse is a opinionated group of R packages that all function similarly. ggplot2 is in there, and I already use that one. I do like R for analysis. (I choose to use it over excel or Stata for my data analysis/ classes), though I wish the help pages were better. Its a hard language to grok, even the data type names are unclear (data frame, vs matrix, vs vectors..). I'll take a look at the tidyverse packages. https://www.tidyverse.org/learn/ https://www.tidyverse.org/learn/ any additional learning resources you'd recommend?
- wodenokoto 7y agoThe “R for Data Science” book by Hadley Wickham (creator of tidyverse, and I believe he is chief data scientist at R Studio) is hands down one of the best introductions to data exploration and analysis.
- bart_spoon 7y agoAs the other commenter said, probably the best resource out there is "R for Data Science" by Hadley Wickham, the architect of the tidyverse. It will get you up and running with the most important parts of the tidyverse (dplyr for data manipulation, ggplot2 for data visualization, tidyr for general data cleaning utilities, etc). Its available online for free here: https://r4ds.had.co.nz/ https://r4ds.had.co.nz/
- deleted 7y ago[deleted]
- CDLcdi 7y agoL9ooks good
- CDLcdi 7y agoLooks good
- DmitryOlshansky 7y agoI hope there was an R 2d2 release at some point...
- bachmeier 7y agoThere was, just not from the R team. The original name of my project for calling from R into D was called rtod2 (playing off D version 2).
- bsg75 7y agoI’m disappointed 64-bit integers are not mentioned. That is an unusual omission in a current language, and the add on packages are not always a substitute. Is anyone here aware if that is planned to be a core addition?
- rgovostes 7y agoR is the worst programming language I've touched. I usually hear in response, "it may be quirky, but it has a lot of well-tested functions useful for data analysis." This confidence seems misplaced. Experienced developers using better languages with better tooling create bugs all the time. How likely is it that R packages, written by specialists (or grad students) whose main focus is often not programming but some other discipline, in a language full of "quirks," are going to be really reliable? One quirk that got me the last time I touched R was that functions and variables live in different namespaces, so you could assign 4 to foo and then call it. Fun fact, a lot of the R source code is machine translated from Fortran to C, but it has been cleaned up a lot. https://github.com/wch/r-source/search?p=1&q=f2c&unscoped_q=f2c https://github.com/wch/r-source/search?p=1&q=f2c&unscoped_q=...
- s1t5 7y ago> One quirk that got me the last time I touched R was that functions and variables live in different namespaces, so you could assign 4 to foo and then call it. Either I'm greatly misunderstanding or this is just plain wrong - assigning something to the same name as an existing function will just overwrite the function.
- notafraudster 7y agoYou're correct provided the overwrite is occurring in the same namespace (e.g. the local environment). He is correct for the wrong reason if you try to alias something from another environment. For example, the following R code may initial seem weird: my_vec <- c(1, 2, 3) c <- 4 print(c) my_vec2 <- c(5, 6, 7) But as I describe in my top level comment, it has nothing to do with variables versus functions, just how namespaces work.
- salmon30salmon 7y agoYou can't really think of R as a programming language in the sense of how we normally thing of programing languages. I see it as more of a computational scripting language. It is great at what it does.
- enricozb 7y agoIs it still the case that when you have an error in your script (and aren't using RStudio) that you don't get the line number of the error, you just get a traceback?
- jerzyt 7y agoMy daughter is in grad school, learning programming for the first time in her life. She's learning R and Python at the same time. She's finding R much more intuitive.
- danso 7y agoIs she being taught a particular framework in Python, e.g. pandas for doing statistics? When I was teaching programming to non-CS grad students, I chose Python for being more all-purpose and explicit in its syntax/conventions (the latter being not too important for most novices). But I envied the relative ease of setup for R – basically, download R Studio – and how quickly anyone can turn a dataset into nice-looking viz thanks to ggplot2.
- jerzyt 7y agoBeing taught is not really what's taking place. It's more like here's the task, for example the LSVT dataset from UCI - go and build a classifier. Obviously, pandas is a workhorse, and pytorch is also on the horizon. But, in reality she's learning by Google and skype calls with Dad. I have to say I'm stoked that I'm being able to help my daughter in grad school with homework. So many people tap out in elementary.
- rossdavidh 7y agoSpeaking as a programmer, R is deeply unintuitive, but...that's for an experienced programmer's intuition. I believe it is, if not intuitive, then at least less unintuitive for someone with a background other than programming (like, say, statistics). The typical programmer's boggled response to R, somewhat like their response to SQL or CSS, is that most of the languages they look at are descended from C, and anything that is not looks weird. Rather like someone who knows only Indo-European languages encountering a non-IE language for the first time. Of course, any real-life language, whether R or CSS or SQL or C or anything else, has plenty of actual defects to complain about. Like, for example, "=" meaning "change the thing on my left to be the same as what's on my right". But if it's the same defects that you're used to, you don't see them as much.
- mike_ivanov 7y agoCongratulations to the people behind the release. Thank you guys very much. Also, please don't pay attention to the haters. There are people who hate R, and those who wholeheartedly despise Python; those who loathe Java and plenty of those who can't stand Lisp. Though, R for some reason tends to trigger the most exemplary manifestations of this phenomenon.
- bransonf 7y agoAs 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 7y 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.
- stilisstuk 7y agoI love R. But working with 50 million rows in ram is a pain. Anyway to do it differently? I use data.table BTW, so asfactor is always false
- jointpdf 7y agoFor what purpose? There are tons of ways to do it differently, see here: https://cran.r-project.org/web/views/HighPerformanceComputing.html https://cran.r-project.org/web/views/HighPerformanceComputin...
- scottlocklin 7y agoBuy more ram? If you're regularly running into memory performance issues despite using data.table, and you don't feel like fiddling with mmap, consider looking into an APL variant.
- stilisstuk 7y agoWill look into mmap. Thx
- einpoklum 7y agoWhat impact does this have on people _learning_ R? It's a new major version - does it require significant updates for training materials? Are there a lot of outdated idioms now?
- SteveSar 7y agoFirst off, R may be annoying to learn (for instance, just concatenating two strings takes much more typing than Python, say) but once you get to data analysis it’s a dream. (And certainly more Pythonic than Python’s alternatives, which result in code cluttered with lots of periods and references to packages and sub-packages everywhere). Also, the packages work really well with each other—-with Python it seemed like every time I’d upgrade packages with pip, I’d end up with a new conflict I’d have to sort out. And, frankly, having to rely on Anaconda to keep everything from breaking is not exactly ideal. So props to CRAN! Gotta say, though, one of the most annoying things about R is the name. Entering “R” as a search term on job boards tends to lead to a lot of not-very-helpful results. Also, it’d help if the version release names had more order to them. So you’d read some ridiculous phrase like “parachute trombone” and know that it must’ve been released after “mouse parade”.