- 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.
- 虛擬儀器設計測控應用典型實例
- 高效能辦公必修課:Word圖文處理
- LabVIEW虛擬儀器從入門到測控應用130例
- Getting Started with MariaDB
- 模型制作
- CompTIA Linux+ Certification Guide
- CentOS 8 Essentials
- MATLAB/Simulink權威指南:開發環境、程序設計、系統仿真與案例實戰
- Prometheus監控實戰
- 中國戰略性新興產業研究與發展·智能制造裝備
- 精通數據科學:從線性回歸到深度學習
- INSTANT Heat Maps in R:How-to
- WPF專業編程指南
- Building Analytics Teams
- 博弈論與無線傳感器網絡安全