I have a data frame
df=data.frame(a=1:5,b=c(1,3,4,-999999,4))
and want to calculate the average of it, but want to exlcude the outlier, -9999 in this case
Is there a command similar to
na.rm
so I can go
apply(df,1,function(x) mean(if x>-100 & x <100))
note that my df if 600 x 50 dim