README.md

cookie

Travis build status

The goal of cookie is to give a live demonstration for Matt Dray's talk about building a package: https://twitter.com/mattdray/status/1190683525005107200

Installation

You can install {cookie} from github with:

remotes::install_github("zkamvar/cookie")

Example

This is a basic example which shows you how to solve a common problem:

library(cookie)
give_cookie("Zhian")
#> Zhian gets: a cookie!
#> [1] "a cookie"

give_cookie("Rob")
#> Rob gets: a cookie!
#> [1] "a cookie"

Workflow

Here's how we went through to create this:

We set up the project with two commands:

# This will open a new RStudio session
usethis::create_package("~/Desktop/cookie")

# This creates the file called R/give_cookie.R and opens it
usethis::use_r("give_cookie.R")

After that, we wrote the give_cookie() function and added documentation using the {roxygen2} package. The man/ folder was created with:

devtools::document()

We then used the glue package and included it with:

usethis::use_package("glue")

Resources

Writing packages

Documentation

Testing



zkamvar/cookie documentation built on Nov. 8, 2019, 12:37 a.m.