[R] Partialy SOLVED Re: Problems with "pdf" device using "plot" "glht" function on "multcomp" library.

Kenneth Roy Cabrera Torres krcabrer at une.net.co
Wed Sep 15 04:40:20 CEST 2010


Hi R users:

I found a workaround for the problem I posted today.

I simple use "Cairo" library, then I use CairoPDF() function,
and it works!!!

The reason maybe is the acrobat reader, because the "okular" reader
from Ubuntu Linux shows the graphics just right.

Thank you for your help and advice.

Kenneth


El mar, 14-09-2010 a las 12:37 -0400, Jorge Ivan Velez escribió:
> Hola Kenneth,
> 
> 
> Acabo de correrlo en un Mac y funciona bien. Cual es tu sessionInfo()?
> 
> 
> Saludos,
> Jorge
> 
> 
> > sessionInfo()
> R version 2.11.1 Patched (2010-05-31 r52180) 
> x86_64-apple-darwin9.8.0 
> 
> 
> locale:
> [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8
> 
> 
> attached base packages:
> [1] splines   stats     graphics  grDevices utils     datasets
>  methods   base     
> 
> 
> other attached packages:
> [1] multcomp_1.2-0  survival_2.35-8 mvtnorm_0.9-92  seqinr_3.0-0
>  MuMIn_0.13.14  
> 
> 
> loaded via a namespace (and not attached):
> [1] tools_2.11.1
> 
> 
> 
> 
> On Tue, Sep 14, 2010 at 12:34 PM, Kenneth Roy Cabrera Torres
> <krcabrer at une.net.co> wrote:
>         Hi R users:
>         
>         I have de following data frame (called "Sx")
>         
>          Descripcion         Nitratos
>              Cont85g            72.40
>              Cont85g           100.50
>              Cont85g           138.30
>              Cont80g           178.33
>              Cont80g            79.01
>              Cont80g            74.16
>              Cont75g            23.70
>              Cont75g            15.80
>              Cont75g            16.20
>            Patron80g            88.93
>            Patron80g           113.01
>            Patron80g            86.53
>         
>         If I run this code without the "pdf" device
>         it works fine on the screen, but when I
>         use the "pdf" device it does not show in
>         the "plot1.pdf" file what I got on the screen.
>         
>         What am I doing wrong?
>         
>         Thank you for your help.
>         
>         library(multcomp)
>         
>         Sx<-data.frame(Descripcion=
>                      factor(c("Cont85g","Cont85g","Cont85g",
>                               "Cont80g","Cont80g","Cont80g",
>                               "Cont75g","Cont75g","Cont75g",
>                               "Patron80g","Patron80g","Patron80g")),
>                       Nitratos=c(72.40,100.50, 138.30,
>                                 178.33,79.01,74.16,
>                                 23.70, 15.80,16.20,
>                                 88.93,113.01,86.53))
>         pdf("plot1.pdf")
>         m1<-aov(Nitratos~Descripcion-1,data=Sx)
>         vect1<-table(Sx$Descripcion)
>         K<-contrMat(vect1,base=4)
>         dnk<-glht(m1,linfct=K)
>         summary(dnk)
>         
>         old.par<-par(no.readonly = TRUE)
>         par(mai=c(1,2,1.25,1),mgp=c(3,1,0))
>         print(plot(dnk,las=1,xlab=""))
>         print(abline(v=0,lty=2))
>         par(old.par)
>         
>         dev.off()
>         
>         ______________________________________________
>         R-help at r-project.org mailing list
>         https://stat.ethz.ch/mailman/listinfo/r-help
>         PLEASE do read the posting guide
>         http://www.R-project.org/posting-guide.html
>         and provide commented, minimal, self-contained, reproducible
>         code.
> 
>



More information about the R-help mailing list