Why Error in colSums(x, na.rm = T) : invalid 'na.rm' argument in R -


i try calculate sum of each column data x. got error

"error in colsums(x, na.rm = t) : invalid 'na.rm' argument" 

why na.rm argument not work in 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) 

i able recreate bug overriding usual value of t equal na:

> t=na > colsums(all,na.rm=t) error in colsums(all, na.rm = t) : invalid 'na.rm' argument 

so likely, (or funny co-worker?) have defined variable t somewhere in code equal na. undo it, type:

t=true 

or better:

rm(t) 

never forget r doesn't know t => shorthand defined convenience @ startup, nothing more.


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -