按R中的列获取摘要统计信息并放入表中

时间:2018-05-11 16:00:39

标签: r dataframe

我正在使用attitude数据框。我想得到11种不同的中心倾向度量,并将它们放在一个看起来像这样的表中:

Central_Meaures Ratings_Measure ...
mean            65.23
median          55.2
...             ...
cor()           0.5

我这样做了我的桌子:

cntrl_measures <- c(
  'mean'
  ,'median'
  ,'mode'
  ,'max'
  ,'min'
  ,'range'
  ,'quantile'
  ,'IQR'
  ,'var()'
  ,'sd()'
  ,'cor()'
)
ratings_measure <- c(
  '','','','','','','','','','',''
)
priv_measure <- c(
  '','','','','','','','','','',''
)
learn_measure <- c(
  '','','','','','','','','','',''
)
raise_measure <- c(
  '','','','','','','','','','',''
)
critical_measrue <- c(
  '','','','','','','','','','',''
)
advance_measure <- c(
  '','','','','','','','','','',''
)

measure.dataframe <- data.frame(cntrl_measures,
                                ratings_measure,
                                priv_measure,
                                learn_measure,
                                raise_measure,
                                critical_measrue,
                                advance_measure)

想想也许for循环会起作用吗?

0 个答案:

没有答案