Show Menu
Cheatography

hello Cheat Sheet (DRAFT) by

for final exam of kevin

This is a draft cheat sheet. It is a work in progress and is not finished yet.

R的数据类型

整型(int)
数值型/双整­型(n­umeric, double)
逻辑型(lo­gical)
字符型(ch­ara­cter)
复数类型(c­omplex)
日期时间类型­(Date, POSIXct, POSIXlt)
因子类型(f­actor)
NA
NaN
Inf
NULL
typeof­()返­回数据类型
is.foo­()判­断是否­属于某­种类型­foo­,是返­回TR­UE,­否返回­FALSE
as.foo­()强­制转换­成foo类型

四则运算

^
幂运算
%%
取余运算
%/%
整除运算
round()
四舍五入取整数
floor()
向下取整
ceiling()
向上取整
round(­3.1­4159,2) 
# 四舍五入到两位小数
## [1] 3.14
 

R的数据类型

整型(int)
数值型/双整­型(n­umeric, double)