[R] extracting colnames to label plots in a function

2008-07-19 Thread stephen sefick
#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,

Re: [R] extracting colnames to label plots in a function

2008-07-19 Thread Gabor Grothendieck
See ?paste and the collapse argument, in particular: plot(d, main = paste(paste(colnames(x), collapse = ), paste(colnames(y), collapse = ), sep = - )) Also your function sets na.method but never uses it and leaves the par settings changed afterwards. See ?par. It could also

Re: [R] extracting colnames to label plots in a function

2008-07-19 Thread stephen sefick
I can fix the par settings. I am new to function writing. I would like to use the na.method in the d- (x-y) how? I don't know what a driver is sorry for my ignorance On Sat, Jul 19, 2008 at 12:36 PM, Gabor Grothendieck [EMAIL PROTECTED] wrote: See ?paste and the collapse argument, in

Re: [R] extracting colnames to label plots in a function

2008-07-19 Thread stephen sefick
h - structure(c(1L, 2L, 3L, 4L, NA, 6L, 7L, 8L, NA, 10L, 1L, NA, 8L, 7L, 6L, 5L, 4L, 3L, 2L, 1L), .Dim = c(10L, 2L), .Dimnames = list( c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), c(site1, site2)), index = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10), class = zoo) diff.temp - function(x, a,

Re: [R] extracting colnames to label plots in a function

2008-07-19 Thread Gabor Grothendieck
On Sat, Jul 19, 2008 at 12:42 PM, stephen sefick [EMAIL PROTECTED] wrote: I can fix the par settings. I am new to function writing. I would like to use the na.method in the d- (x-y) how? I don't know what a driver is sorry for my ignorance 1. As stated in the prior post its code and data