美文网首页R语言
R---数据类型以及简单命令

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

作者: Juan_NF | 来源:发表于2019-04-17 10:47 被阅读91次

数据类型

  • 意会最重要,因为我已经过了 被考名词解释 的年纪了
  • 整数型
###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"
  • 逻辑型(TRUE/FALSE,T/F)
#####理解一下,这里是把 2>3 的判断结果赋值给了f
> f<-2>3
> f
[1] FALSE
> class(f)
[1] "logical"
> typeof(f)
[1] "logical"

求人不如求‘帮助’

?class
?typeof

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

请审慎清空

  • 控制台内容的清空
  • 图表的清空
  • 环境变量的清空

相关文章

网友评论

    本文标题:R---数据类型以及简单命令

    本文链接:https://www.haomeiwen.com/subject/khkgwqtx.html