Edoardo,

I'm wondering why
   postscript(file=filename)
doesn't suffice, and you need to use "eval" instead?

Regards,

Andrew C. Ward

CAPE Centre
Department of Chemical Engineering
The University of Queensland
Brisbane Qld 4072 Australia
[EMAIL PROTECTED]


Quoting Edoardo Airoldi <[EMAIL PROTECTED]>:

> hello all,
>   I am trying to print a ps file as part of a function as in:
> 
> func <- function (..., filename="temp.ps") {
>       # some stuff
>       [...]
> 
>      # plot
>      eval( cat("postscript(\"",filename,"\")\n", sep="") )
>      plot(...)
>      abline(...)
>      dev.off()
> 
>       # more stuff
>       [...]
> }
> 
> but it does not work.  Nor it does with 'paste' instead of
> 'cat'.  In 
> order to make it work I have to call:
>  > postscript("temp.ps")
>  > func(...)
>  > dev.off()
> 
> I am wondering why is that?  How can I make my call to
> postscript within a 
> function sort of 'global' ??
> thanks
> Edo
> 
> ______________________________________________
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help

Reply via email to