I am able to recreate your bug by overriding the usual value of T
to be equal to NA
:
> T=NA
> colSums(all,na.rm=T)
Error in colSums(all, na.rm = T) : invalid 'na.rm' argument
So most likely, you (or a funny co-worker?) have defined the variable T
somewhere in your code to be equal to NA
. To undo it, just type:
T=TRUE
or better:
rm(T)
Never forget that R doesn't really know about T
=> it is just a shorthand defined for convenience at startup, nothing more.