[R] eval(), expression()
Wolfgang Koller
koller2 at fgr.wu-wien.ac.at
Tue Jul 6 13:05:36 CEST 1999
Dear R-Users!
My aim is to produce boxplots without the outliers included in the
plot. I started to write a function that looks something like:
myboxplot <-function(x,fa) {
bpdata <- boxplot(x~fa,plot=FALSE)
bpnames <- names(bpdata)
for (JJ in bpnames) {
command <- paste("bpdata$",JJ,"$out <- numeric(0)",sep="");
eval(command)
}
bxp(bpdata)
}
Obviously this does not work as I intended since the argument
of eval() should be of type expression. However, with
expression() there is no way to have variable JJ evaluated first.
Does anybody see a way to solve this problem?
Thanks for any suggestions!
Wolfgang Koller
P.S.: Similar problems with expression() can arise with producing
annotations in plots.
----------------------------------------------------------
Wolfgang Koller, koller2 at fgr.wu-wien.ac.at
Research Institute for European Affairs
Vienna University of Economics and Business Administration
Althanstrasse 39-45, 1090 Vienna, Austria
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
More information about the R-help
mailing list