[R] Ask for help on the parallel function output to a pdf file

Deepayan Sarkar deepayan at stat.wisc.edu
Sun Feb 20 23:01:21 CET 2005




http://cran.r-project.org/doc/FAQ/R-FAQ.html#Why-do-lattice_002ftrellis-graphics-not-work_003f


On Sunday 20 February 2005 15:35, Warren.Jin at csiro.au wrote:
> Dear all,
>
>
>
> Could you please give me a hand on parallel function from package
> lattice?
>
>
>
> On the R command console, the following commands can output a
> parallel coordinate plot to the pdf file.
>
> library(lattice); pdf("trial.pdf"); data(iris); parallel(~iris[1:4] |
> Species, iris); dev.off();
>
> However, if these commands are encapsulated into a function, the
> resultant pdf file is empty. For example, we define a simple function
> paraExam below, paraExam() may generate a pdf file which is empty
> from a pdf viewer.
>
> paraExam<-function(file="trial.pdf"){
>
>  library(lattice);
>
>  pdf(file);
>
>  data(iris);
>
>  parallel(~iris[1:4] | Species, iris);
>
>  dev.off();
>
>  }
>
>
>
> Please give me some tips to output parallel coordinate plots to a pdf
> file within a function successfully?




More information about the R-help mailing list