StupidBeauty
Read times:443Posted at:Mon Jun 25 05:53:01 2012
- no title specified

转载:S向量

R中声明一个常量向量可以这样:marks <- c(10, 6, 4, 7, 8),这个时候marks就是一个5个元素的向量咯。

http://www.stathome.cn/manual/s/02.html

亮点:

向量(Vector)与赋值

向量是具有相同基本类型的元素序列,大体相当于其他语言中的一维数组。实际上在S 中标量也被看作是长度为1的向量。

定义向量的最常用办法是使用函数c(),它把若干个数值或字符串组合为一个向量,比如:

> marks <- c(10, 6, 4, 7, 8)

> x <- c(1:3, 10:13)

> x

[1] 1 2 3 10 11 12 13

> x1 <- c(1, 2)

> x2 <- c(3, 4)

> x <- c(x1, x2)

> x

[1] 1 2 3 4

Your opinions
Your name:Email:Website url:Opinion content:
- no title specified

HxLauncher: Launch Android applications by voice commands

 
Recent comments
2017年4月~2019年4月垃圾短信排行榜Posted at:Thu Sep 26 04:51:48 2024
Qt5.7文档翻译:QWebEngineCookieStore类,QWebEngineCookieStore ClassPosted at:Fri Aug 11 06:50:35 2023盲盒kill -9 18289 Grebe.20230517.211749.552.mp4