亲爱的大家,
早在2014年,Hadley Wickham’s dplyr
tutorial at useR!2014 drew a lot of attention to the %>%
(pipe) operator from the 磁珠
package. While the pipe operator is an essential part of the tidyverse 因此,对于属于tidyverse伞包(例如dplyr,tidyr或purrr)的软件包的用户来说,这是众所周知的,因此对于某些人来说,一定牛遗漏操作员可能仍然是新手。
几周前,我最初打算对R中的一定牛遗漏进行简短介绍,但是当我遇到一个最近的 Karlijn Willems在DataCamp博客上的教程。我随后的搜索很快发现,鉴于大量关于该主题的出色教程,因此在一定牛遗漏操作员上发表另一篇文章是多余的。因此,我没有复制已经在其他地方以吸引人的方式获得的信息,而是’d宁愿提供几个指向有趣资源的链接,其中包含您可以在该主题上获得更多信息的地方。
在一定牛遗漏运算符上有一些不错的小插曲,教程和博客文章。另外,那里’是Hadley Wickham的专门部分’关于数据科学的优秀著作R:
- 哈德利·威克姆(Hadley Wickham): 第18章:R for Data Science中的一定牛遗漏
- 哈德利·威克姆(Hadley Wickham): 部分‘Piping’ of the
dplyr
小插图 - Stefan Milton Bache /哈德利·威克姆(Hadley Wickham):
磁珠
小插图 - Stefan Milton Bache / Tal Galili: 使用一定牛遗漏简化R编码>magrittr软件包的现在和未来
- 大卫·史密斯: 磁珠 :使用一定牛遗漏简化R代码
- 弗朗西斯·斯玛特: R中带有一定牛遗漏的更多可读代码
- 马丁·约翰逊(Martin Johnsson): %。%和%更有趣>%
不过,我确实有一些补充说明:
- In the context of geoinformatics and spatial 数据 management, it is worth knowing that the
sf
package is designed to support dplyr-style verbs and the pipe-operator. - The
磁珠
package also contains the%<>%
operator (called the magritts compound assignment pipe-operator), which pipes an object forward into a function or call expression and update the initial object with the resulting value. For instance, instead ofx <- as_data_frame(x)
you can simply usex %<>% as_data_frame
.
问候,
马蒂亚斯
图片来源:N.N .: Pipes-1008898_1920.jpg©CC0
发表回复