datalorax/slidex

Use system.file() for the example

Closed this issue · 2 comments

pat-s commented

Otherwise the path of the example file is not found:

library(slidex)
convert_pptx(path = "inst/examples/slidedemo.pptx",
             author = "Daniel Anderson", force = T)
#> Warning in file.rename(file.path(xml_folder, ppt), gsub("\\.pptx",
#> "\\.zip", : cannot rename file 'slidedemo_xml/slidedemo.pptx' to
#> 'slidedemo_xml/slidedemo.zip', reason 'No such file or directory'
#> Warning in unzip(gsub("\\.pptx", "\\.zip", file.path(xml_folder, ppt)), :
#> error 1 in extracting from zip file
#> Error in slds[[1]]: subscript out of bounds

Using system.file() should solve the issue.

The idea of the package is great btw! Have to check it out with some complex pptx and see how the outcome looks like. We should definitely link this to the xaringan wiki.

cc @yihui FI

I’m traveling today but will try to fix this later tonight or tomorrow. Thanks!

This should be fixed now. Thanks again!