magrittr
TidyverseSkeptic
Our great sponsors
magrittr | TidyverseSkeptic | |
---|---|---|
10 | 13 | |
951 | 507 | |
0.0% | - | |
2.3 | 3.3 | |
about 1 year ago | 4 months ago | |
R | TeX | |
GNU General Public License v3.0 or later | - |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
magrittr
- This is not a pipe - René Magritte
-
Six programming languages I’d like to see
R (yes, the statistics language) has exactly this.
You can literally extract the body of a function as a list of "call" objects (which are themselves just dressed-up lists of symbols), inject/delete/modify individual statements, and then re-cast your new list to a new function object.
I don't know why the original devs thought this was necessary or even desirable in a statistics package, but it turns out to be a lot of fun to program with. It has also made possible a wide variety of clever and elegant custom syntaxes, such as a pipe infix operator implemented as a 3rd-party library without any custom language extensions [0]. The pipe infix operator got so popular that it was eventually made part of the language core syntax in version 4.1 [1].
[0]: https://magrittr.tidyverse.org/
[1]: https://www.r-bloggers.com/2021/05/the-new-r-pipe/
- Hadley is pro- base pipe.
-
Functional pipes in python like %>% from R's magrittr
In R (thanks to magrittr) you can now perform operations with a more functional piping syntax via %>%. This means that instead of coding this:
-
Question about dot notation
Try reading the documentation for magrittr.
-
When did WG21 decide this is what networking looks like?
Related note: the statistical programming language R has a library named magrittr to support the pipe operator.
-
How can I find the data entry of the row after one found?
About the pipe (%>%) symbol, it's provided by the magrittr package. The package documentation details how to use the pipe operator.
-
Best practice for chaining nested functions?
I was wondering what some good ways are to handle nested function calls without chaining them in long, ugly nested statements. I am looking for functionality similar to the pipe forward operator %>% in magrittr/R or |> in F#.
-
I much prefer `data.action()` to `action(data). Is it an r/unpopularopinion?
You may like R: https://magrittr.tidyverse.org
-
What's so "tidy" about tidyverse?
Agreed on everything else you said (especially the type safety stuff, it massively helps in production), but one correction: magrittr is absolutely in the tidyverse suite. It's not considered one of its "core" packages that it visibly tells you it loads, but magrittr is loaded when calling library(tidyverse) and development of the package is handled by the tidyverse team under their Github account: https://github.com/tidyverse/magrittr
TidyverseSkeptic
-
Why Pandas feels clunky when coming from R
I just don't get these to be honest -- besides the fact that author missed simple things like `df.groupby('var',as_index=False)`, isn't this obviously arbitrary "this is easier my way" complaints? (I did R before all the chaining stuff was popular, and I wouldn't stuff everything into a single command like that even now. It isn't like you get lazy evaluation or any special data processing magic.)
So I get people love chaining and tidyverse, good for you, I don't. But at least I can acknowledge that my way (or this way) people have different preferences and one is not intrinsically easier.
Norm Matloff has a blog where he essentially just argues the opposite of all the tidyverse stuff, https://github.com/matloff/TidyverseSkeptic, but it is the same idea in reverse to me (one is not obviously easier to learn than the other IMO).
-
Where to learn R?
On the other hand, there is also a more traditional universe outside of the of the newer tidyverse approach. See the criticism of the tidyverse ecosystem by Prof Norm Matloff (of UC Davis). He provides a freely available introductory course in base R.
-
I will take that odds
Whenever I hear tidyverse, I just feel the need to leave this: TidyverseSceptic
-
Base-R Is Alive and Well
Yeah, I had never heard of him before, but I followed the link in the article above to his GitHub page and think he made some really great points about conciseness and clarity in base R code, and, I admittedly had no idea tapply() was so useful and easy to use, because I almost never see it used in any examples online. Although I agree with others here that he's misrepresenting why package developers use base R (which is to avoid dependences in their packages, which is very important), I also find myself agreeing with him that future R programmers not being taught base R is worrisome (I'm thinking of dependencies in future package development).
-
Your thoughts on base R? I never considered it and, after reading seemingly know little about it.
I was in an R group meeting. One of the members mentioned Prof. Norm Matloff and said he has comments about tidyverse. I searched and found Matloff's explanation here. What are your thoughts on tidyverse and Matloff's comments about it? As I read it, I found myself agreeing with certain points. I do not have a computer science background; I'm someone trying to learn coding because I see uses for it in my work. I started my learning, about a year ago, with tidyverse tutorials. My patchwork jumping around, maybe in addition to some of the gaps Matloff indicates, show me that I know very little about base R.
-
In charge of making the transition from Excel to R at the office
There are good arguments against tidyverse, especially for beginners. It doesn't lead to a growth in understanding the language fundamentals and requires to learn many functions, paradigms, and syntaxes not shared by base R, which can easily be overwhelming and lead to a learn-by-heart approach more than to a learn-by-understanding. There are many good articles on the topic, such as this one or a more in-depth one, suggesting to consider tidyverse a more advanced application for specific use cases, if you like the dialect. I don't, so I might be biased.
- Teaching R in a Kinder, Gentler, More Effective Manner
- An opinionated view of the Tidyverse “dialect” of the R language
-
Thoughts on book?
I would discourage you to get into the tidyverse, at least in the first stages of your R training. It's like trying to learn english AND scottish together as a foreigner. You can read some better worded discussions here https://github.com/matloff/TidyverseSkeptic and here https://towardsdatascience.com/a-thousand-gadgets-my-thoughts-on-the-r-tidyverse-2441d8504433?gi=1b0a3648b6e6
-
Ho everyone I am R beginer. I need to to change the data type of these two columns, I tried as many ways I could find on the internet but it just won't work for me. This is really frustrating especially when you are a beginer, can you pleae provide a solution ? Thanks a lot in advance !
My opinions are largely in agreement with Norm Matloff on the subject actually.
What are some alternatives?
dplyr - dplyr: A grammar of data manipulation
Chain.jl - A Julia package for piping a value through a series of transformation expressions using a more convenient syntax than Julia's native piping functionality.
scenebuilder - Scene Builder is a visual, drag 'n' drop, layout tool for designing JavaFX application user interfaces.
RCall.jl - Call R from Julia
kitten - A statically typed concatenative systems programming language.
VegaLite.jl - Julia bindings to Vega-Lite
power-fx-host-samples - Samples for hosting Power Fx engine.
PackageCompiler.jl - Compile your Julia Package
libuv-tutorial - http://nikhilm.github.io/uvbook/
Transformers.jl - Julia Implementation of Transformer models
ggplot2 - An implementation of the Grammar of Graphics in R
swirl - :cyclone: Learn R, in R.