Roger Dungan wrote: > [snip]> > There are obvious work-rounds, like > >>sd(x, is.na(x)==F) > > which gives the result (with error message) > [1] 1.707825 > Warning message: > the condition has length > 1 and only the first element will be used in: > if (na.rm) "complete.obs" else "all.obs" >
What you are doing here looks very odd to me -- you are passing a vector of logicals as the value for the argument na.rm. This is odd because na.rm should be just a single logical value, not a vector of the same length as x (hence the warning message). Only the first element of that vector is used, so you are passing essentially a random value. By luck, in your example, the first element was T, which is why you got a value of 1.707825 as the result, and not NA. The rest might fall into place when this understanding is cleared up. -- Tony Plate ______________________________________________ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html