R语言

R---数据类型以及简单命令

2019-04-17  本文已影响91人  Juan_NF

数据类型

  • 意会最重要,因为我已经过了 被考名词解释 的年纪了
###A non-negative integer specifying the desired length. Double values will be coerced to integer: supplying an argument of length other than one is an error.
> a<-as.integer(5)
> a
[1] 5
> class(a)
[1] "integer"
#####我想让你注意的是小数点和负号
> b<-1.2
> class(b)
[1] "numeric"
#####你看这个引号,是不是很有标志性,文本类型
> d<-'1bc'
> class(d)
[1] "character"
> typeof(d)
[1] "character"
#####理解一下,这里是把 2>3 的判断结果赋值给了f
> f<-2>3
> f
[1] FALSE
> class(f)
[1] "logical"
> typeof(f)
[1] "logical"

求人不如求‘帮助’

?class
?typeof

R中无处不在的‘小扫把’

请审慎清空

上一篇 下一篇

猜你喜欢

热点阅读