From c8c25993d8fc098c6ecf0440be570e7b015434cc Mon Sep 17 00:00:00 2001 From: rserran Date: Tue, 19 Mar 2024 18:26:30 -0400 Subject: [PATCH 1/2] Add resources file --- .../Meeting_06/resources | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Reproducible_pipelines_book_club/Meeting_06/resources diff --git a/Reproducible_pipelines_book_club/Meeting_06/resources b/Reproducible_pipelines_book_club/Meeting_06/resources new file mode 100644 index 0000000..5a4f3ba --- /dev/null +++ b/Reproducible_pipelines_book_club/Meeting_06/resources @@ -0,0 +1,15 @@ +R packages resources: + +R Packages (2e) https://r-pkgs.org/introduction.html + +Writing an R package from scratch https://hilaryparker.com/2014/04/29/writing-an-r-package-from-scratch/ + +Building R packages https://www.paulamoraga.com/blog/2022/04/12/2022-04-12-rpackages/ + + Share your R work following good dev practices from a single notebook https://statnmap.com/2022-10-28-share-your-r-work-following-good-dev-practices-from-a-single-notebook/ + + fusen vignette https://thinkr-open.github.io/fusen/ + + R Packages: Workflows, practices, and tools for happy development https://www.youtube.com/live/-i9WZutXkPs?si=sVgj6VYYAk17psFe + + \ No newline at end of file From 46b5bd9788d8ea66c159f4c821b19d1177bfa27d Mon Sep 17 00:00:00 2001 From: rserran Date: Wed, 3 Apr 2024 19:51:51 -0400 Subject: [PATCH 2/2] Update Chappter 11 notes. Add DESCRIPTION example file and fusen_tutorial.R script --- .../Meeting_07/DESCRIPTION | 18 ++++++++++++++++++ .../Meeting_07/chapter_11.html | 6 +++++- .../Meeting_07/chapter_11.qmd | 3 +++ .../Meeting_07/fusen_tutorial.R | 17 +++++++++++++++++ 4 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 Reproducible_pipelines_book_club/Meeting_07/DESCRIPTION create mode 100644 Reproducible_pipelines_book_club/Meeting_07/fusen_tutorial.R diff --git a/Reproducible_pipelines_book_club/Meeting_07/DESCRIPTION b/Reproducible_pipelines_book_club/Meeting_07/DESCRIPTION new file mode 100644 index 0000000..a6998f9 --- /dev/null +++ b/Reproducible_pipelines_book_club/Meeting_07/DESCRIPTION @@ -0,0 +1,18 @@ +Package: libminer +Title: Explore Your R Libraries +Version: 0.0.0.9000 +Authors@R: + person("Ricardo", "Serrano", , "rserran1@gmail.com", role = c("aut", "cre"), + comment = c(ORCID = "")) +Description: Provides functions for learning about your R libraries, and the packages you have installed. +License: MIT + file LICENSE +Encoding: UTF-8 +Roxygen: list(markdown = TRUE) +RoxygenNote: 7.2.3 +URL: https://github.com/rserran/libminer, https://rserran.github.io/libminer/ +BugReports: https://github.com/rserran/libminer/issues +Suggests: + testthat (>= 3.0.0) +Config/testthat/edition: 3 +Imports: + fs (>= 1.5) diff --git a/Reproducible_pipelines_book_club/Meeting_07/chapter_11.html b/Reproducible_pipelines_book_club/Meeting_07/chapter_11.html index 95341c5..d0e6434 100644 --- a/Reproducible_pipelines_book_club/Meeting_07/chapter_11.html +++ b/Reproducible_pipelines_book_club/Meeting_07/chapter_11.html @@ -12,7 +12,7 @@ - quarto-input20a7e03d + quarto-input66bdf568 @@ -425,6 +425,7 @@

Learning objectives:

  • How to turn .Rmd files, including datasets, into a package.
  • Installing and sharing the package.
  • Conclusions
  • +
  • Q & A
  • @@ -582,6 +583,9 @@

    Conclusions

  • For beginners, I would recommend to learn the traditional process (step-by-step) of developing R packages (usethis, devtools, roxygen2, etc.).
  • When you feel more comfortable, then I would recommend to use {fusen}.
  • +
    +
    +

    Q & A

    diff --git a/Reproducible_pipelines_book_club/Meeting_07/chapter_11.qmd b/Reproducible_pipelines_book_club/Meeting_07/chapter_11.qmd index 1fe1a5e..9866d2c 100644 --- a/Reproducible_pipelines_book_club/Meeting_07/chapter_11.qmd +++ b/Reproducible_pipelines_book_club/Meeting_07/chapter_11.qmd @@ -32,6 +32,7 @@ knitr::opts_chunk$set(echo = TRUE, warning = FALSE, message = FALSE, eval = FALS - How to turn .Rmd files, including datasets, into a package. - Installing and sharing the package. - Conclusions +- Q & A # @@ -185,3 +186,5 @@ fusen::inflate(flat_file = "dev/save_data.Rmd", vignette_name = "Nominal house p - Developing an R package is a rite passage for any user to learn good coding and documentation practices. - For beginners, I would recommend to learn the traditional process (step-by-step) of developing R packages (usethis, devtools, roxygen2, etc.). - When you feel more comfortable, then I would recommend to use `{fusen}`. + +## Q & A diff --git a/Reproducible_pipelines_book_club/Meeting_07/fusen_tutorial.R b/Reproducible_pipelines_book_club/Meeting_07/fusen_tutorial.R new file mode 100644 index 0000000..522ef27 --- /dev/null +++ b/Reproducible_pipelines_book_club/Meeting_07/fusen_tutorial.R @@ -0,0 +1,17 @@ +# Building reproducible analytical pipelines with R +# Chapter 11 - Packaging your code + +# load packages +if (!require("fusen")){ + install.packages("fusen") + library(fusen) +} + +# quickstart +fusen::create_fusen(path = "fusen.quickstart", + template = "minimal") + +# set and try pkgdown documentation website +usethis::use_pkgdown() +pkgdown::build_site() +