1

I wonder if there is any principled way of including internal functions from other packages in an R package. Specifically I would like to use rmarkdown:::html_dependencies_as_string in my package.

I can of course copy the source code of this function to my package (giving credits to the authors of course). However, I wonder if there is any better way of doing this?

sztal
  • 287
  • 2
  • 10
  • Sorry, read a little too fast. [This](https://stackoverflow.com/q/32535773/324364) probably covers the limited options. (I don't think they extend much beyond what you cover.) – joran Jun 20 '17 at 21:37
  • 1
    One reason package maintainers may not export a function is that they may want to change it's behavior later without impacting their users. If an unexported function has behavior you like, it's much safer to to copy it (as licenses permit, with attribution) in case it changes to something you don't like later on. – Gregor Thomas Jun 20 '17 at 21:42
  • Thanks, it seems you are both right and there is no better way of doing it than copying the function or asking authors to export it. – sztal Jun 20 '17 at 21:46

0 Answers0