Skip to content

Commit

Permalink
Merge pull request tomwenseleers#20 from davidgohel/master
Browse files Browse the repository at this point in the history
use ph_with instead of ph_with_* functions
  • Loading branch information
cvanderaa authored Apr 2, 2020
2 parents 4107fbf + 0780bff commit 4261707
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: export
Type: Package
Title: Streamlined Export of Graphs and Data Tables
Version: 0.2.2.9000
Version: 0.2.2.9001
Date: 2018-09-18
Authors@R: c(person("Tom", "Wenseleers", role = c("aut", "cre"),
email = "[email protected]"),
Expand Down
4 changes: 2 additions & 2 deletions R/graph2office.R
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,13 @@ graph2office = function(x = NULL, file = "Rplot", fun = NULL, type = c("PPT","DO
offy = (pagesize["height"] + margins["top"]+margins["bottom"] - h)/2
}
if(vector.graphic){
doc = ph_with_vg_at(doc, code = myplot(), left = offx, top = offy, width = w, height = h, ...)
doc = ph_with(doc, dml(code = myplot()), location = ph_location(left = offx, top = offy, width = w, height = h), ...)
} else {
temp.file <- paste0(tempfile(), ".png")
grDevices::png(filename = temp.file, height = h, width = w, units = "in", res = 300)
myplot()
dev.off()
doc <- ph_with_img_at(doc, src = temp.file, left = offx, top = offy, width = w, height = h)
doc <- ph_with(doc, external_img(src = temp.file), location = ph_location(left = offx, top = offy, width = w, height = h))
unlink(temp.file)
}
} else {
Expand Down
2 changes: 1 addition & 1 deletion R/table2office.R
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ table2office = function(x = NULL, file = "Rtable", type = c("PPT","DOC"), append


if(type=="PPT"){
doc <- ph_with_flextable_at(doc, value = tab , left=offx, top=offy)
doc <- ph_with(doc, value = tab , location = ph_location(left = offx, top = offy))
} else if(type == "DOC"){
doc <- body_add_flextable(doc, value = tab)
}
Expand Down

0 comments on commit 4261707

Please sign in to comment.