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
You can just use sum(people$Weight).
sum(people$Weight)
sum sums up a vector, and people$Weight retrieves the weight column from your data frame.
sum
people$Weight
Note - you can get built-in help by using ?sum, ?colSums, etc. (by the way, colSums will give you the sum for each column).
?sum
?colSums
colSums