How to sum data.frame column values?

后端 未结 4 1587
梦谈多话
梦谈多话 2020-12-07 15:13

I have a data frame with several columns; some numeric and some character. How to compute the sum of a specific column? I’ve googled for this and I see nume

4条回答
  •  既然无缘
    2020-12-07 15:54

    to order after the colsum :

    order(colSums(people),decreasing=TRUE)
    

    if more than 20+ columns

    order(colSums(people[,c(5:25)],decreasing=TRUE) ##in case of keeping the first 4 columns remaining.
    

提交回复
热议问题