I want to calculate the sum of the columns, but exclude one column.How can I specify what column to exclude while adding the sum of each row.
hd_total<-rowSums(hd) #hd is where the data is that is read is being held
hn_total<-rowSums(hn)
rowSums(hd[, -n])
where n
is the column you want to exclude.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With