R里面有几个内置常量,方便我们直接调用而非创建:
想要了解R的内置常量,可以?Constants 命令查询:
?Constants
其常量如下:
1、26个字母LETTERS, 小写字母怎么办? 有letters
> LETTERS
[1] "A" "B" "C" "D" "E" "F" "G" "H" "I" "J" "K" "L" "M" "N" "O" "P" "Q" "R" "S" "T" "U" "V" "W" "X"
[25] "Y" "Z"
2、月份,缩写用month.abb,全名用month.name
> month.abb
[1] "Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep" "Oct" "Nov" "Dec"
> month.name
[1] "January" "February" "March" "April" "May" "June" "July" "August"
[9] "September" "October" "November" "December"
3、圆周率pi
> pi
[1] 3.141593
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!