[R] Baffled: triggering error message with an sd result in odfWeave?
Tubin
sredmonson at yahoo.com
Mon Dec 15 18:17:04 CET 2008
Unfortunately - no luck. Changing to the ifelse construction didn't fix the
problem, and changing the "" to a zero or a NA also didn't help.
Meanwhile, I have 4 other sd calculations on the same dataset, using the
same construction, elsewhere in the document and code. None of them are
giving me any problems whatsoever.
I think it because you are trying to use the if-else control
construct, when you should be using the ifelse function:
?ifelse
Try (perhaps):
traindev <- ifelse( (trainlength>0), round(sd(trainscores, na.rm=T),
1) , "")
You do seem to be mixing types, though, so perhaps you should use NA
instead of "".
--
David Winsemius
--
View this message in context: http://www.nabble.com/Baffled%3A-triggering-error-message-with-an-sd-result-in-odfWeave--tp21016679p21017853.html
Sent from the R help mailing list archive at Nabble.com.
More information about the R-help
mailing list