I think many of the gotchas and annoying parts of base R are solved by using tools from the tidyverse: http://github.com/tidyverse . For example, the pain of needing to specify `stringsAsFactors=FALSE` is solved in the tibble package by setting a sensible default. At any rate, at least it's not Pandas and matplotlib...
A newcomer’s (angry) guide to R
11–20 of 232 posts
Re: A newcomer’s (angry) guide to R
#12Having used Python, JSL, Julia, R and Matlab; I agree with most of the things in R. R is an extremely ugly language. It seems to be created by people who wear capris and uggs (both at the same time). But, R has incredible packages, especially the work done by Hadley Wickam. ggplot2 is beautiful. It is utterly gorgeous. It is what Ted Baker is to the capri guys that designed the language itself.
Re: A newcomer’s (angry) guide to R
#13Having used Python, JSL, Julia, R and Matlab; I agree with most of the things in R. R is an extremely ugly language. It seems to be created by people who wear capris and uggs (both at the same time). But, R has incredible packages, especially the work done by Hadley Wickam. ggplot2 is beautiful. It is utterly gorgeous. It is what Ted Baker is to the capri guys that designed the language itself.
My personal hack to deal with the unbearable ugliness of R is to use Rpy2 and call R packages from Python --- at least writing some boilerplate code in Python makes me happier than having to write in R.
Re: A newcomer’s (angry) guide to R
#14>A R factor is a sequence type much like a character atomic vector except that the values of the factor are constrained to a set of string values, called “levels”. For example, if you have a table of measurements of some widgets and each row corresponds to a single measurement of a single widget, you could have a factor-typed column called measurement.type containing the values “length”, “width”, “height”, “weight”,…
> This is a very bad example of what factors are for in R, because it makes it seem like factors are for defining variables or keys in key value pairs That is the approach for tidy data, which is used a lot in the R tidyverse ( http://tidyr.tidyverse.org/articles/tidy-data.html )
> That is the approach for tidy data, which is used a lot in the R tidyverse (http://tidyr.tidyverse.org/articles/tidy-data.html)
Do you have a reference to where Hadley et al. suggest using factors in a key-value system? I'm reading Wickham's books at the moment and have not seen this assertion. Indeed, I believe he would not state this, as he explains the utility of factors explicitly:
A factor is a vector that can contain only predefined values, and is used to store categorical
data... Factors are useful when you know the possible values a variable may take, even if you don’t
see all values in a given dataset...
Advanced R, pp. 21-22Re: A newcomer’s (angry) guide to R
#15I'll add that concepts like data frames are not really intrinsic, and you get needless complexities like "length", "nrow", "dim", each of which does the wrong thing in 90% of the scenarios of interest. The confusion of lvalues is another strange quirk -- a If you discipline yourself to learning "the good parts", especially by learning either data.tables or tidyverse or becoming a master of split/lapply/aggregate/ave, then it is very powerful. The modelling tools and plotting (both base graphics and ggplot2) are excellent.
I'd love to see a NeoR arise at some point that fixes the strange historical inconsistencies (like what happens when you refer to vec[0], as noted by the author) in non-backward compatible ways.
Re: A newcomer’s (angry) guide to R
#16Re: A newcomer’s (angry) guide to R
#17Earlier quoted context omitted.
> This is a very bad example of what factors are for in R, because it makes it seem like factors are for defining variables or keys in key value pairs That is the approach for tidy data, which is used a lot in the R tidyverse ( http://tidyr.tidyverse.org/articles/tidy-data.html )
>> This is a very bad example of what factors are for in R, because it makes it seem like factors are for defining variables or keys in key value pairs > That is the approach for tidy data, which is used a lot in the R tidyverse ( http://tidyr.tidyverse.org/articles/tidy-data.html ) Do you have a reference to where Hadley et al. suggest using factors in a key-value system? I'm reading Wickham's books at the moment an…
Re: A newcomer’s (angry) guide to R
#18Having used Python, JSL, Julia, R and Matlab; I agree with most of the things in R. R is an extremely ugly language. It seems to be created by people who wear capris and uggs (both at the same time). But, R has incredible packages, especially the work done by Hadley Wickam. ggplot2 is beautiful. It is utterly gorgeous. It is what Ted Baker is to the capri guys that designed the language itself.
Notably the use of + instead of chaining operators, the use of a custom "ggproto" object system instead of S3 (which makes extensibility a nightmare), and the superfluous presence of the aes() function (rendered unnecessary by better lazy evaluation tricks not really well-explored at the time).
Re: A newcomer’s (angry) guide to R
#19I understand some of this stuff is actually seen as a positive for Python in some contexts (production usage) and I agree. Just pointing out the woke take is the languages are both good, but good at different things. If I need to run a quick analysis on a dataset, I'm grabbing R 9/10 times. If I'm building a production pipeline, I'm using Python 9/10 times. This is perfectly fine.
Re: A newcomer’s (angry) guide to R
#20I clicked because I was a programmer for 15 years before I used R, and I have subsequently developed and shipped R packages, so I feel like I'm in a pretty good position to get the visceral, cathartic, "argh" the writer here was going for.