Closed sbellan61 closed 7 years ago
mydoc <- pptx()# title = "title" ) mydoc <- addSlide( mydoc, slide.layout = "Title and Content" ) ## myPlot = qplot(Sepal.Length, Petal.Length, data = iris, ## **works** ## color = Species, size = Petal.Width, alpha = I(0.7) ) ## mydoc = addPlot(mydoc, fun = function() barplot(1:8, col = 1:8, fg='white', col.axis='white')) ## **works** myPlot = barplot(1:8) ## **doesn't work** mydoc <- addPlot( doc = mydoc, fun = print, x = myPlot, offx = 1, offy = 1, width = 6, height = 5 ) mydoc <- addFlexTable( doc = mydoc, FlexTable( head( iris ) ), offx = 8, offy = 2, width = 4.5, height = 3 ) filename <- "force_pos_size.pptx" # the document to produce writeDoc( mydoc, file = filename )
Error in .jcall(slide, "I", "add", dml.object, width, height, offx, offy) : javax.xml.bind.UnmarshalException
You have this error because myPlot contains a vector not a ggplot object, print(myPlot) is not producing any plot.
myPlot
print(myPlot)
Error in .jcall(slide, "I", "add", dml.object, width, height, offx, offy) : javax.xml.bind.UnmarshalException