I try to calculate the sum of each column for my data x. But I always got this error
"Error in colSums(x, na.rm = T) : invalid 'na.rm' argument"
Why the na.rm
argument does not work in this case?? confused...
x <- cbind(x1 = 3, x2 = c(4:1, 2:5))
x[3, ] <- NA; x[4, 2] <- NA
rowSums(x)
colSums(x, na.rm=T)