摘要: R语言入门基础教程:常用运算函数。对一般数据进行运算的常用函数:1、round() #四舍五入例:x <- c(3.1416, 15.377, 269.7)round(x, 0) #保留整数位round(x, 2) #保留两位小数round(x, -1) #保留到十位2、signif() #取有效数字(跟学过的有效数字不是一个意思)例:略3、trunc() #取整 floor() #向下取整 ceiling() #向上取整例:xx <- c(3.60, 12.47, -3.60, -12.47)trunc(xx)floor(xx)ceiling(xx)4、logb(a, b) #以 阅读全文
posted @ 2012-12-18 22:51 快乐的Developer 阅读(379) 评论(0) 推荐(0) 编辑