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 numerous functions (sum
, cumsum
, rowsum
, rowSums
, colSums
, aggregate
, apply
) but I can’t make sense of it all.
For example suppose I have a data frame people
with the following columns
people <- read(
text =
"Name Height Weight
Mary 65 110
John 70 200
Jane 64 115",
header = TRUE
)
…
How do I get the sum of all the weights?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…