[R] how to manipulate ... within a function

Dan Kelley Dan.Kelley at dal.ca
Fri Dec 19 14:16:30 CET 2008


Thanks very much, Duncan.  In case it's of interest to others who encounter
this thread later, I am pasting below the code I wrote.  It is for the 'oce'
package for oceanographic data, which explains the reversal of the y axis,
forming a so-called 'profile', in which the top of the graph represents the
top of the water column.

        args <- list(x=x$data$temperature, y=x$data$pressure,
                     xlim=range(x$data$temperature),
                     log="",
                     ylim=rev(range(x$data$pressure)),
                     xlab=expression(paste("Temperature [", degree, "C ]")),
                     ylab="p [dbar]", ...)
        if (!("type" %in% names(list(...)))) args <- c(args, type="p")
        if (!("cex"  %in% names(list(...)))) args <- c(args, cex=0.3)
        do.call(plot, args)


-- 
View this message in context: http://www.nabble.com/how-to-manipulate-...-within-a-function-tp21083637p21091033.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list