Hacker News new | past | comments | ask | show | jobs | submit | firstinstinct's comments login

at the end of the comments of the post http://varianceexplained.org/r/teach-tidyverse/

compare base R:

  var1 <- "pounds"
  var2 <- "wt"
  mtcars[[var1]] <- mtcars[[var2]]/1000
Now hadley solution comment: You can now express that sort of thing fairly elegantly with dplyr:

  var1 <- sym("pounds")
  var2 <- sym("wt")
  mtcars <- mutate(mtcars,!!var1 := !!var/100)

  
 Watch your steps: !!, :=, sym.

Thats a lot of added complexity to be able to use column names, and to top it all, the use of non standard evaluation make things very complex when one go a little away from basic EDA.


Well, strictly literately to this case the tidyverse command would be:

mtcars %<>% mutate(pounds = wt / 1000)

Which is obviously simpler, and quite likely what a beginner is actually trying to do.

The real complaint - "tidyverse doesn't let us use variables to name columns!" - is fair enough, following quasiquotation is hard work. If you need that, drop back to base R. However, it is harder to teach because all the common operations (select, filter, etc) will involve some combination of []/[[]] and relatively hard to figure out which one a piece of code is trying to do.

Except for the lucky few who have brains wired to think in terms of arrays and database relations, someone learning the language is unlikely to thank you for that.


What I see clearly is that is not a good option to begin with R inferno, except when you are a fighter prepared to learn at any cost.



Put a lot of false food for the squirrels and estimate the squirrel population by how much false food they try to eat.

False food: It looks like fruit but taste very bad, it is suppose only one bite for each animal.


Long time ago I failed to solve this conjecture. Nice to see it have been solved. I shared some email with S. Hetdetniemi about some special cases. Good old times.


What results and special cases did you work on?


I cannot remember. I emailed him about some results, he said they were interesting, but later I discovered those results were already published. I told him : I will throw them to trash. Very impolite from my part!, that must be 20 years ago.


Perhaps the reason is they think they will be left behind?


Related: Our first instinct is far too often wrong (finantial times, 10 May 2019, Tim harford, pay walled article).

Another related article: Heads or Tails: The Impact of a Coin Toss on Major Life Decisions and Subsequent Happiness Steven D. Levitt https://www.nber.org/papers/w22487


Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: