how to feed a non R file in a function within a package? -


i creating package including functions use generate report. use template report. wondering whether can include template (a word doc file) inside folder in package & make function use it? more specifically, couldn't figure out how need specify filepath of doc file inside function. help?

library(reporters)
if(!exists("temp")) temp = docx(title> ="summary", template="c:\users\user\a_template.docx")

syntax above current setup.

with of @benbolker's suggestion, able fix syntax.

if(!exists("temp"))      temp <- docx(title = "summary",          template=system.file("a_template.docx", package="my.package")) 

Comments

Popular posts from this blog

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -