[R] extracting colnames to label plots in a function

From: stephen sefick <ssefick_at_gmail.com>
Date: Sat, 19 Jul 2008 12:04:30 -0400


#this is my little function that I would like to use the column names of the
x and y arguments in the function. I would like it to read
# site1-site2 how would I do this
diff.temp <- function(x, y ,use="pairwise.complete.obs") {

    na.method <- pmatch(use, c("all.obs", "complete.obs",     "pairwise.complete.obs"))
    par(mfrow=c(2,1))

    d <- (x-y)
    plot(d, main="paste(colnames(x))-paste(colnames(y))")     plot(density(na.omit(coredata(d))))
}

-- 
Let's not spend our time and resources thinking about things that are so
little or so large that all they really do for us is puff us up and make us
feel like gods. We are mammals, and have not exhausted the annoying little
problems of being mammals.

-K. Mullis

	[[alternative HTML version deleted]]

______________________________________________
R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Received on Sat 19 Jul 2008 - 16:07:21 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 19 Jul 2008 - 17:32:00 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive