2015-01-17 13 views
1

Есть ли способ получить оттенки серого решетчатые участки с ReportR? trellis.device(color=FALSE), кажется, не работает здесьнастроить ReporteRs для получения градаций серой шкалы

library(ReporteRs) 
library(lattice) 

trellis.device(color=FALSE) # set grayscale 

p <- xyplot(decrease ~ treatment, OrchardSprays, groups = rowpos, 
      auto.key =list(space = "right")) 

print(p) # ok, grayscale 

doc = pptx("Test") 
doc = addSlide(doc, "Title and Content") 
doc = addPlot(doc, fun = print, x = p) # not ok, colored 
writeDoc(doc, "test.pptx") 

здесь

enter image description here

вместо

enter image description here

ответ

1

это нормально, при использовании trellis.par.set. См. Ниже:

library(ReporteRs) 
library(lattice) 

p <- xyplot(decrease ~ treatment, OrchardSprays, groups = rowpos, 
      auto.key =list(space = "right")) 

ltheme <- standard.theme(color = FALSE) 

doc = pptx("Test") 
doc = addSlide(doc, "Title and Content") 
doc = addPlot(doc, fun = { 
    trellis.par.set(ltheme) 
    print(p) 
}) 
writeDoc(doc, "test.pptx")