- R Programming By Example
- Omar Trejo Navarro
- 154字
- 2021-07-02 21:30:39
Complex logic with control structures
The final topic we should cover is how to introduce complex logic by using control structures. When I write introduce complex logic, I don't mean to imply that it's complex to do so. Complex logic refers to code that has multiple possible paths of execution, but in reality, it's quite simple to implement it.
Nearly every operation in R can be written as a function, and these functions can be passed through to other functions to create very complex behavior. However, it isn't always convenient to implement logic that way and using simple control structures may be a better option sometimes.
The control structures we will look at are if... else conditionals, for loops, and while loops. There are also switch conditionals, which are very much like if... else conditionals, but we won't look at them since we won't use them in the examples contained in this book.
- 現(xiàn)代測(cè)控系統(tǒng)典型應(yīng)用實(shí)例
- Dreamweaver CS3網(wǎng)頁(yè)制作融會(huì)貫通
- Windows XP中文版應(yīng)用基礎(chǔ)
- WordPress Theme Development Beginner's Guide(Third Edition)
- 完全掌握AutoCAD 2008中文版:綜合篇
- 21天學(xué)通Visual C++
- Visual Basic.NET程序設(shè)計(jì)
- 分析力!專(zhuān)業(yè)Excel的制作與分析實(shí)用法則
- 網(wǎng)絡(luò)管理工具實(shí)用詳解
- 嵌入式GUI開(kāi)發(fā)設(shè)計(jì)
- Puppet 3 Beginner’s Guide
- 人工智能:智能人機(jī)交互
- 機(jī)器人制作入門(mén)(第4版)
- 菜鳥(niǎo)起飛五筆打字高手
- Mastercam X5應(yīng)用技能基本功特訓(xùn)