A minimal example package with pkgdown documentation created and uploaded by tic (the pkgdown documentation is written to, and served from, the docs
directory of the master
branch.).
tic is an R package for CI-agnostic workflow definitions for various R projects.
See its documentation for more information.
If you want to experiment with travis and tic for a R package, you can fork it.
usethis::create_from_github()
to automatically create a fork of this repo.
If you use RStudio, a new RStudio project will open.
You may need to set up your SSH credentials first.
See this guide if you're having problems.
(It's definitely worth getting this function running as it saves you a lot of time in the future!)
Alternatively, fork this repo on Github and then create a new R Project within RStudio (File -> New Project -> Version Control -> Github). tic::use_tic()
to set up all requirements needed for the CI integration of your package.This is the detailed way going step by step from the bottom up. Looking here can be useful if you already have an R package and just want to add some functionality to it, e.g. using roxygen2 with Markdown (item 3) or enabling CI for your package (item 6).
Use usethis::create_package("<path-to-package-dir>")
.
Here is an example with a package called tic.package
stored within the ~/git/
directory:
r
usethis::create_package("~/git/tic.package")
✔ Changing active project to '/home/<username>/git/tic.package'
✔ Creating 'R/'
✔ Creating 'man/'
✔ Writing 'DESCRIPTION'
✔ Writing 'NAMESPACE'
✔ Writing 'tic.package.Rproj'
✔ Adding '.Rproj.user' to '.gitignore'
✔ Adding '^tic.package\\.Rproj$', '^\\.Rproj\\.user$' to '.Rbuildignore'
✔ Opening new project 'tic.package' in RStudio
Initialize Git via usethis::use_git()
:
``` ✔ Changing active project to '/home//git/tic.package' ✔ Initialising Git repo ✔ Adding '.Rhistory', '.RData' to '.gitignore' OK to make an initial commit of 5 files? 1: Yup 2: No 3: Absolutely not
Selection: 1 ✔ Adding files and committing ● A restart of RStudio is required to activate the Git pane ● Restart now? 1: Absolutely 2: No way 3: Absolutely not
Selection: 1 ```
(Optional) Use roxygen2 with Markdown support for package documentation: usethis::use_roxygen_md()
:
r
✔ Changing active project to '/home/<username>/git/tic.package'
✔ Setting Roxygen field in DESCRIPTION to 'list(markdown = TRUE)'
✔ Setting RoxygenNote field in DESCRIPTION to '6.0.1.9000'
● Run `devtools::document()`
Add a license: usethis::add_gpl3_license()
(or any license of your choice):
r
✔ Changing active project to '/home/<username>/git/tic.package'
✔ Setting License field in DESCRIPTION to 'GPL-3'
✔ Writing 'LICENSE.md'
✔ Adding '^LICENSE\\.md$' to '.Rbuildignore'
Create a Github repo by using usethis::use_github()
:
```r ● Check title and description Name: tic.package Description: What the Package Does (One Line, Title Case) Are title and description ok? 1: No way 2: I agree 3: Nope
Selection: 2 ✔ Creating GitHub repository ✔ Adding GitHub remote ✔ Adding GitHub links to DESCRIPTION ✔ Setting URL field in DESCRIPTION to 'https://github.com//tic.package' ✔ Setting BugReports field in DESCRIPTION to 'https://github.com//tic.package/issues' ✔ Pushing to GitHub and setting remote tracking branch ```
Set up Continuous Integration by using tic::use_tic()
. Take a look at the Getting Started vignette of the tic package for a detailed walkthrough.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.