【R】小计
> range(lifeexp) [1] 47.794 83.394 > max(lifeexp) [1] 83.394 > min(lifeexp) [1] 47.794 > IQR(lifeexp) [1] 11.986 > var(lifeexp) [1] 93.48446 > sd(lifeexp) [1] 9.668736 > sqrt(var(lifeexp)) [1] 9.668736 > round(sd(lifeexp),1) [1] 9.7 > med=medion(lifeexp) 错误: 没有"medion"这个函数 > med=median(lifeexp) > range=max(lifeexp)-min(lifeexp) > std.dev=sd(lifeexp) > trim=c(med,range,std.dev,trim) 错误: 找不到对象'trim' > trim=c(med, range) > trim=c(med,range,std.dev,trim) > trim [1] 73.235000 35.600000 9.668736 73.235000 35.600000 > renames(trim)=c('med','range','std.dev','trim') 错误于renames(trim) = c("med", "range", "std.dev", "trim") : 没有"renames<-"这个函数 > rownames(trim)=c('med','range','std.dev','trim') 错误于`rownames<-`(`*tmp*`, value = c("med", "range", "std.dev", "trim" : 不能给没有维度的对象设行名 > trime=c(med,range,std.dev,trim)) 错误: 意外的')'在"trime=c(med,range,std.dev,trim))"里 > trime=c(med,range,std.dev,trim) > ststs=cbind(trim,trime) 警告信息: In cbind(trim, trime) : number of rows of result is not a multiple of vector length (arg 1) > ststs trim trime [1,] 73.235000 73.235000 [2,] 35.600000 35.600000 [3,] 9.668736 9.668736 [4,] 73.235000 73.235000 [5,] 35.600000 35.600000 [6,] 73.235000 9.668736 [7,] 35.600000 73.235000 [8,] 9.668736 35.600000 > rownames(ststs)=c('med','range','std.dev','trim') 错误于`rownames<-`(`*tmp*`, value = c("med", "range", "std.dev", "trim" : 'dimnames'的长度[1]必需与陈列范围相等 > trim [1] 73.235000 35.600000 9.668736 73.235000 35.600000 > trime [1] 73.235000 35.600000 9.668736 73.235000 35.600000 9.668736 73.235000 [8] 35.600000 > trime=trime[2:6] > ststs=cbind(trim,trime) > ststs trim trime [1,] 73.235000 35.600000 [2,] 35.600000 9.668736 [3,] 9.668736 73.235000 [4,] 73.235000 35.600000 [5,] 35.600000 9.668736 > rownames(ststs)=c('med','range','std.dev','trim') 错误于`rownames<-`(`*tmp*`, value = c("med", "range", "std.dev", "trim" : 'dimnames'的长度[1]必需与陈列范围相等 > rownames(ststs)=c('med','range','std.dev','trim','a') > ststs trim trime med 73.235000 35.600000 range 35.600000 9.668736 std.dev 9.668736 73.235000 trim 73.235000 35.600000 a 35.600000 9.668736 >