Convert summary to data.frame

前端 未结 2 1325
醉话见心
醉话见心 2020-12-05 07:29

I have this admission_table containing ADMIT, GRE, GPA and RANK.

> head(admission_table)
         


        
2条回答
  •  一向
    一向 (楼主)
    2020-12-05 07:55

    Another way to output a dataframe is:

    as.data.frame(apply(mydf, 2, summary))
    

    Works if only numerical columns are selected.

    And it may throw an Error in dimnames(x) if there are columns with NA's. It's worth checking for that without the as.data.frame() function first.

提交回复
热议问题