R language notes | pipes: chaining
df-sum <- df %>%
mutate(bar = bar(foo)) %>%
mutate(compare = bar > baz) %>%
mutate(express = ifelse(compare, "greater than baz",baz )) %>%
group_by(express) %>%
summarise(n = n(), mean = mean(bar))
would be equal to
df_sum <- summarise(group_by(mutate(express = ifelse(mutate(compare = mutate(df, bar = bar(foo)) > baz), "greater than baz",baz ))), n = n(), mean = mean(bar))
pipe
%>% takes whatever is on the left of the pipe.
Check if there are the same variables on the left and right. If there are not, uses it as the first argument of the function on the right. Otherwise, rewrites the same variable.
相關文章
- Angular 自定義管道 pipes 的使用Angular
- 精讀《Optional chaining》AI
- JavaScript 裡的 Promise ChainingJavaScriptPromiseAI
- Row Chaining and MigratingAI
- PCTFREE, PCTUSED, and Row Chaining(七)AI
- Row Chaining and Migrating(六)AI
- Mongodb NotesMongoDB
- 14-2 鏈地址法 Seperate ChainingAI
- TypeScript 中 Optional Chaining 和 Nullish CoalescingTypeScriptAINull
- 6.2、串連ViewResolver(Chaining ViewResolvers)ViewAI
- Chaining If Else Statements 巨坑的題目AI
- js方法鏈(Method Chaining)簡單介紹JSAI
- c++stl notesC++
- Linux配置notesLinux
- BlockRecover Restrictions and Usage NotesBloCREST
- Make notes for disaster recoveryAST
- Thinking in java notesThinkingJava
- The Go Programming LanguageGo
- the java programming languageJava
- 為什麼我喜歡JavaScript的Optional ChainingJavaScriptAI
- Index of system requirements for Notes, Domino, Domino Administrator, Domino Designer & Notes TravelIndexUIREM
- Oracle10g Export/Import DataPump Does Not Work with Tapes or UNIX Named Pipes [ID 276521.1]OracleExportImport
- nestJs中 Guards ,Interceptors ,Pipes ,Controller ,Filters的執行順序JSControllerFilter
- Notes與Office的介面
- Oracle Training NotesOracleAI
- Google分析language垃圾資訊Go
- Bitbucket Pipes釋出,帶來30+自動化CI/CD管道的方法
- D3 JS study notesJS
- Notes about Vue Style GuideVueGUIIDE
- Android Weekly Notes Issue #255Android
- Notes for building gimp-printUI
- Notes與Office的介面 (轉)
- Notes of Oracle 11.2 Dataguard setupOracle
- Execl匯入notes JAVA代理Java
- jQuery|開發了這麼多年終於懂了“鏈(Chaining)”jQueryAI
- Row Migration and Row Chaining(行遷移和行連結)AI
- (C language Sample ) Compile procedureCompile
- Domino XML Language(DXL)簡介XML