- Machine Learning with R Quick Start Guide
- Iván Pastor Sanz
- 80字
- 2021-06-24 16:01:29
Functions on vectors
In addition to the functions and operators that we've seen for numerical values, there are some specific functions for vectors, such as the following:
- Sum of the elements present in a vector:
sum(x)
## [1] 23
- Product of elements in a vector:
prod(x)
## [1] 360
- Length of a vector:
length(x)
## [1] 4
- Modifying a vector using the <- operator:
x
## [1] 9 8 1 5
x[1]<-22
x
## [1] 22 8 1 5
推薦閱讀
- Div+CSS 3.0網頁布局案例精粹
- 高性能混合信號ARM:ADuC7xxx原理與應用開發
- Practical Data Wrangling
- Getting Started with MariaDB
- 自動化控制工程設計
- 21天學通ASP.NET
- 大數據平臺異常檢測分析系統的若干關鍵技術研究
- 網絡安全與防護
- Hadoop應用開發基礎
- Word 2007,Excel 2007辦公應用融會貫通
- Visual Studio 2010 (C#) Windows數據庫項目開發
- 電動汽車驅動與控制技術
- 西門子S7-1200/1500 PLC從入門到精通
- 軟件測試設計
- Getting Started with Tableau 2019.2