[R] generic argument passing to plot function

statquant2 statquant at gmail.com
Wed Sep 28 17:01:30 CEST 2011


Hello I am trying to write a function that would plot timeseries easily...
I aim at plotting two time-series on 2 different y axis sharing the same
x-axis

I succeded in doing so: 
plotTimeSerie(x,y,y2,[a lot of other args]){
...
plot()
axis.POSIXct(side=1) #here I build the x-axis 
points() #here I plot the first time serie related to y-axis
...
axis(side=2,[some args])
text(side=2,text="",[some args]) #here I build the y-left axis and annotate
with text
...
points() #here I plot the first time serie related to y-right axis
axis(side=4,[some args])
text(side=2,text="",[some args]) #here I build the y-right axis and annotate
with text

}

My problem is that I would like the user to be able to specify any
parameters he wishes for the axis/points functions.
How can I make plotTimeSerie handling any parameters and pass them into the
specified functions (points,axis...)?

--
View this message in context: http://r.789695.n4.nabble.com/generic-argument-passing-to-plot-function-tp3851599p3851599.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list