我如何能够遍历数据框的列以获取一些摘要统计信息?
>df <- read.csv("myfile", sep='\t')
>
>column <- df$column_name # How can I implement this part in a loop?
>column.freq = table(x)
此外,在某些情况下,每行的值都是非数字数据。我怎样才能得到一个有意义的意思?因为当我手动执行此操作时,我得到的返回值为6838.667
,这在非数字数据中没有任何意义。
示例输出:
Column: col_name
mean: value (either numerical or nominal)
median: same as above
mode: same as above
dispersion: same as above