变量不需要声明,
常用的变量有:
变量类型 | 定义 | 例子 | 例子效果 |
logical | 逻辑型:TRUE , FALSE | v<-TRUE; print(class(v)) | "logical" |
numeric | 数字型:23.4, 2 , | v<-23.5;print(class(v)) | "numeric" |
integer | 整型:2L, 0L | v<-2L;print(class(v)) | "numeric" |
complex | 复合型 | v<-3+2i;print(class(v)) | "complex" |
character | 字符型:‘a‘,"FALSE" | v<-"TRUE";print(class(v)) | "character" |
raw | 原型:"Hello" 被存储为 48 65 6c 6c 6f | v<-charToRaw("Hello"); print(class(v)); print(v) |
[1] "raw" |
原文:https://www.cnblogs.com/Elanlalala/p/10486102.html