[R] compose a name in function

Uwe Ligges ligges at statistik.uni-dortmund.de
Mon Jun 2 14:03:01 CEST 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)
> ...
> }
> 
> Thanks
> R. Bertola

Use paste(), as in

  win.metafile(paste(name, "%02d.wmf", sep="-"), pointsize = 14)

Uwe Ligges




More information about the R-help mailing list