[R] problem in deparse(substitute())

vito muggeo vito.muggeo at giustizia.it
Wed Sep 18 11:49:52 CEST 2002


Hi all,
I am experiencing the following quite strange (at least in my knowledge)
problem in a simple function like the following:

fn<-function(y,v=2){
    n<-length(y)
    y<-y[(v+1):(n-v)]
 plot(y,type="l",lty=3,xlab="Time",ylab=deparse(substitute(y)))
    }

fn(rnorm(50)) #look at the plot!!!

The plot appears with numbers on the left side!
If I delete the deparse(substitute()) in the ylab argument in the plot()
function
or I omit the line "y<-y[(v+1):(n-v)]" everything works well.

I can not test whether this problem depends on my R system (R 1.5.1 Win Me),
but I have never had no problem before.

many thanks for your help,

bests,
vito

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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