I write a function to plot some graphs and a gave for it one result of lm() (reg) and a character (name). In win.metafile("name-%02d.wmf", pointsize = 14) i want compose de name of file with the string i pass to the function. How i can make this? plota.res.grava <- function(reg,name){ win.metafile("name-%02d.wmf", pointsize = 14) ... } Thanks R. Bertola -- bertola at fastmail.fm -- http://www.fastmail.fm - And now for something completely different
?paste as in win.metafile(paste(name, "%02d.wmf", sep="-"), pointsize = 14) On Mon, 2 Jun 2003, Rafael Bertola wrote:> I write a function to plot some graphs and a gave for it one result of > lm() (reg) and a character (name). In win.metafile("name-%02d.wmf", > pointsize = 14) i want compose de name of file with the string i pass to > the function. How i can make this? > > plota.res.grava <- function(reg,name){ > > win.metafile("name-%02d.wmf", pointsize = 14) > ... > }-- Brian D. Ripley, ripley at stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595
Rafael Bertola wrote:> I write a function to plot some graphs and a gave for it one result of > lm() (reg) and a character (name). In win.metafile("name-%02d.wmf", > pointsize = 14) i want compose de name of file with the string i pass to > the function. How i can make this? > > plota.res.grava <- function(reg,name){ > > win.metafile("name-%02d.wmf", pointsize = 14) > ... > } > > Thanks > R. BertolaUse paste(), as in win.metafile(paste(name, "%02d.wmf", sep="-"), pointsize = 14) Uwe Ligges