1. 赋值
“<-”
不推荐使用“=”赋值。
2. 注释:
#”
3. R大小写敏感。
4.下标从1开始,不是从0.
运算符
- Addition: +
- Subtraction: -
- Multiplication: *
- Division: /
- Exponentiation: ^
- Modulo: %%
数据类型:
- Decimals values like 4.5 are called numerics.
- Natural numbers like 4 are called integers. Integers are also numerics.
- Boolean values (TRUE or FALSE) are called logical.
- Text (or string) values are called characters.
运算
判断相等 ==
AND运算 &
OR运算 |
非运算 !
&& 与 & : 若作用于vector, &&只比较第一个元素
|| 与 | : 若作用于vector, ||只比较第一个元素
学习资料: