Learn R Programming

archivist (version 2.3.8)

addHooksToPrint: Add archivist Hooks to rmarkdown Reports

Description

addHooksToPrint adds an overloaded version of the print function for objects of selected class. The overloaded function will add all objects of selected class to the Repository and then will add hooks (to the Remote or Local Repository) to the HTML report (generated in rmarkdown) for these objects (artifacts - archivistPackage). The great example can be seen in this blogpost.

Usage

addHooksToPrint(
  class = "ggplot",
  repoDir = aoptions("repoDir"),
  repo = aoptions("repo"),
  user = aoptions("user"),
  branch = "master",
  subdir = aoptions("subdir"),
  format = "markdown"
)

Arguments

class

A character with a name of class (one or more) that should be archived.

repoDir

A character containing a name of a Local Repository.

repo

A character with a name of a Remote repository on which the Repository is archived. If repo = NULL then hooks will be added to files in local directories.

user

A character with a name of a Remote-repository user on whose account the repo is created.

branch

A character with a name of Remote-repository's branch on which the Repository is archived. Default branch is master.

subdir

A character with a name of a sub directory on a Remote repository on which the Repository is stored. If the Repository is stored in main folder on a Remote repository, this should be set to subdir = "/" as default.

format

A character denoting format as in alink.

Contact

Bug reports and feature requests can be sent to https://github.com/pbiecek/archivist/issues

Author

Przemyslaw Biecek, przemyslaw.biecek@gmail.com

References

Biecek P and Kosinski M (2017). "archivist: An R Package for Managing, Recording and Restoring Data Analysis Results." _Journal of Statistical Software_, *82*(11), pp. 1-28. doi: 10.18637/jss.v082.i11 (URL: http://doi.org/10.18637/jss.v082.i11). URL https://github.com/pbiecek/archivist

See Also

Other archivist: Repository, Tags, %a%(), addTagsRepo(), aformat(), ahistory(), alink(), aoptions(), archivistPackage, aread(), areadLocal(), asearch(), asearchLocal(), asession(), atrace(), cache(), copyLocalRepo(), createLocalRepo(), createMDGallery(), deleteLocalRepo(), getRemoteHook(), getTagsLocal(), loadFromLocalRepo(), md5hash, removeTagsRepo(), restoreLibs(), rmFromLocalRepo(), saveToLocalRepo(), searchInLocalRepo(), setLocalRepo(), shinySearchInLocalRepo(), showLocalRepo(), splitTagsLocal(), summaryLocalRepo(), zipLocalRepo()

Examples

Run this code

if (FALSE) {
# only in Rmd report, links to github repository
addHooksToPrint(class="ggplot", repoDir = "arepo",
repo="graphGallery", user="pbiecek")
# only in Rmd report, links to local files
addHooksToPrint(class="ggplot", repoDir = "arepo",
repo=NULL)
}

Run the code above in your browser using DataLab