diff --git a/week3/doubler.R b/week3/doubler.R index f4c599c..45cf9f9 100644 --- a/week3/doubler.R +++ b/week3/doubler.R @@ -2,9 +2,18 @@ devtools::dev_sitrep() library(devtools) # Create package with one function that doubles numbers -create_package("/tmp/doubler") -setwd("/tmp/doubler") -use_git() + +# Since github already set up, we will do that first + +create_from_github( + repo_spec = "numbats/assignment-1-package-creation-robjhyndman", + destdir = "~/Desktop/", + protocol = "ssh" +) +# Rename folder and Rproj to your package name +create_package("~/Desktop/doubler") +use_github_links() + use_gpl3_license() diff --git a/week3/slides.qmd b/week3/slides.qmd index 43c3e59..c820daa 100644 --- a/week3/slides.qmd +++ b/week3/slides.qmd @@ -176,7 +176,12 @@ install.packages(c("devtools", "roxygen2", "testthat", "knitr")) ### Verify \vspace*{-0.2cm} -`devtools::dev_sitrep()` + +```{r} +#| eval: false +library(devtools) +dev_sitrep() +``` ## Package states @@ -210,10 +215,21 @@ install.packages(c("devtools", "roxygen2", "testthat", "knitr")) ## Exercise: Start on your package -```{r} -#| eval: false -usethis::create_package() -``` +1. Because we have already set up github repos for everyone, we need to first clone the repo to your local machine. Then we can start working on the package. + + ```{r} + #| eval: false + create_from_github("numbats/assignment-1-package-creation-robjhyndman") + ``` + +2. Rename folder and Rproj file to your package name + +3. Create package skeleton + + ```{r} + #| eval: false + create_package() + ``` ## Workflow