knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", eval = TRUE, message = FALSE, warning = FALSE, error = FALSE, tidy = TRUE )
The intent of pkgpeanuts
is to automate building out robust R package scaffolding for a newly created package. Create a new R package project in RStudio. Then let pkgpeanuts
take care of the rest. It is important to note that the primary function pkgpeanuts::pour
is not intended for existing packages.
After creating a new local package project with git in RStudio, call pkgpeanuts::pour
from the package root directory with your desired arguments. I suggest not doing this, however. Instead, use the convenient RStudio addin.
pkgpeanuts
has many arguments. See the help documentation for details. And again, this is not intended for existing packages.
This is relevant particularly for Windows users. I have not tested on other systems.
pour
function itself), will do the following:cred <- git2r::cred_ssh_key(publickey = "~/../.ssh/id_rsa.pub", privatekey = "~/../.ssh/id_rsa") usethis::use_github(credentials = cred)
This is the only way I currently have things functioning without errors.
In the addin, the code linting option is currently disabled. Note that if you provide lintr = "test"
to pour
and receive a warning like the following:
In file.symlink("inst/.lintr", ".lintr") : cannot symlink 'inst\.lintr' to '.lintr', reason 'A required privilege is not held by the client'
this means that pour
was unable to create a symlink due to restricted permissions. You need to run RStudio as administrator to avoid this warning. The symbolic link is necessary for the current approach to combining lintr
with testthat
unit testing and not failing a Travis-CI build. I think there is now another way to do this, but I have not looked into it yet. Stay tuned.
Add an existing, external Shiny app to a source package with use_app
. This will copy the app into the inst
directory. For example:
use_app("../app")
By default this will also add a template DESCRIPTION
file and template Readme.md
file. These files can also be added separately using use_app_description
and use_app_readme
. This gives more control over the content output by use_app_description
. These files are useful for Shiny showcase mode.
use_app_description("path/to/app", title = "My app", author = "Me", url = "example.com", tags = c("data analysis", "graphing")) use_app_readme()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.