Functional Programming in R 4: Advanced Statistical Programming for Data Science, Analysis, and Finance 2/e
暫譯: R 4 的函數式程式設計:數據科學、分析與金融的進階統計程式設計(第二版)
Mailund, Thomas
- 出版商: Apress
- 出版日期: 2023-06-09
- 售價: $1,700
- 貴賓價: 9.5 折 $1,615
- 語言: 英文
- 頁數: 158
- 裝訂: Quality Paper - also called trade paper
- ISBN: 1484294866
- ISBN-13: 9781484294864
-
相關分類:
R 語言、Data Science
立即出貨 (庫存=1)
商品描述
Master functions and discover how to write functional programs in R. In this book, updated for R 4, you'll learn to make your functions pure by avoiding side effects, write functions that manipulate other functions, and construct complex functions using simpler functions as building blocks.
In Functional Programming in R 4, you'll see how to replace loops, which can have side-effects, with recursive functions that can more easily avoid them. In addition, the book covers why you shouldn't use recursion when loops are more efficient and how you can get the best of both worlds.
Functional programming is a style of programming, like object-oriented programming, but one that focuses on data transformations and calculations rather than objects and state. Where in object-oriented programming you model your programs by describing which states an object can be in and how methods will reveal or modify that state, in functional programming you model programs by describing how functions translate input data to output data. Functions themselves are considered to be data you can manipulate and much of the strength of functional programming comes from manipulating functions; that is, building more complex functions by combining simpler functions.
What You'll Learn
- Write functions in R 4, including infix operators and replacement functions
- Create higher order functions
- Pass functions to other functions and start using functions as data you can manipulate
- Use Filer, Map and Reduce functions to express the intent behind code clearly and safely
- Build new functions from existing functions without necessarily writing any new functions, using point-free programming
- Create functions that carry data along with them
Who This Book Is For
Those with at least some experience with programming in R.
商品描述(中文翻譯)
掌握函數並學習如何在 R 中編寫函數式程式。在這本針對 R 4 更新的書中,您將學會如何通過避免副作用來使您的函數純粹,編寫操作其他函數的函數,並使用更簡單的函數作為構建塊來構建複雜的函數。
在《Functional Programming in R 4》中,您將看到如何用遞迴函數替代可能有副作用的迴圈,這樣可以更輕鬆地避免副作用。此外,本書還涵蓋了為什麼在迴圈更有效率時不應使用遞迴,以及如何獲得兩者的最佳效果。
函數式程式設計是一種程式設計風格,類似於物件導向程式設計,但它專注於數據轉換和計算,而不是物件和狀態。在物件導向程式設計中,您通過描述物件可以處於哪些狀態以及方法如何揭示或修改該狀態來建模您的程式;而在函數式程式設計中,您通過描述函數如何將輸入數據轉換為輸出數據來建模程式。函數本身被視為可以操作的數據,函數式程式設計的強大之處在於操作函數;也就是說,通過組合更簡單的函數來構建更複雜的函數。
**您將學到的內容**
- 在 R 4 中編寫函數,包括中置運算子和替代函數
- 創建高階函數
- 將函數傳遞給其他函數,並開始將函數用作可以操作的數據
- 使用 Filer、Map 和 Reduce 函數清晰且安全地表達代碼背後的意圖
- 使用無點編程從現有函數構建新函數,而不必編寫任何新函數
- 創建攜帶數據的函數
**本書適合誰**
對 R 編程有一定經驗的人士。
作者簡介
Thomas Mailund is Senior Software Architect at Kvantify, a quantum computing company from Denmark. He has a background in math and computer science. He now works on developing algorithms for computational problems applicable for quantum computing. He previously worked at the Bioinformatics Research Centre, Aarhus University, on genetics and evolutionary studies, particularly comparative genomics, speciation, and gene flow between emerging species. He has published Beginning Data Science in R with Apress, as well as other books out there.
作者簡介(中文翻譯)
Thomas Mailund 是來自丹麥的量子計算公司 Kvantify 的資深軟體架構師。他擁有數學和計算機科學的背景。目前,他專注於為量子計算開發適用於計算問題的演算法。他曾在奧胡斯大學的生物資訊研究中心工作,專注於遺傳學和進化研究,特別是比較基因組學、物種形成以及新興物種之間的基因流動。他與 Apress 合作出版了 Beginning Data Science in R,以及其他相關書籍。