r sum based on two columns
aggregate(x$Frequency, by=list(Category=x$Category), FUN=sum)
Category x
1 First 30
2 Second 5
3 Third 34
r sum based on two columns
aggregate(x$Frequency, by=list(Category=x$Category), FUN=sum)
Category x
1 First 30
2 Second 5
3 Third 34
how to get sum of rows and columns of a matrix in R
#Suppose x is a matrix
x<-matrix()
#Vector of Row sums of x
rowSums(x)
#Vector of Col sums of x
colSums(x)
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us