2015-01-17 7 views
1

그레이 스케일 트 리뷰는 ReportRs를 사용합니까? trellis.device(color=FALSE)ReporteR을 구성하여 그레이 스케일 격자 플롯을 얻으십시오

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

대신 trellis.par.set를 사용하는 경우는 OK입니다

enter image description here

답변

1

의 여기에 작동하지 않을 것 같다. 아래 참조 :

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")