From 46448e05784d598d2a233ca5d6b61b21ab137a9c Mon Sep 17 00:00:00 2001 From: Martin Frigaard Date: Sat, 28 Oct 2023 13:36:22 -0700 Subject: [PATCH] Built site for gh-pages --- .nojekyll | 2 +- app_packages.html | 26 +++++------------- comparisons.html | 4 +-- data.html | 2 +- debugging.html | 36 ++++++++++++------------- dependencies.html | 2 +- development.html | 2 +- document.html | 2 +- external.html | 38 +++++++++++++------------- launch.html | 30 ++++++++++----------- packages.html | 6 ++--- search.json | 10 +++---- shiny.html | 50 +++++++++++++++++----------------- sitemap.xml | 68 +++++++++++++++++++++++------------------------ test_mocks.html | 14 +++++----- test_modules.html | 18 ++++++------- test_specs.html | 12 ++++----- test_suite.html | 12 ++++----- test_tools.html | 50 +++++++++++++++++----------------- whole_game.html | 2 +- 20 files changed, 187 insertions(+), 199 deletions(-) diff --git a/.nojekyll b/.nojekyll index fcab837..ae27146 100644 --- a/.nojekyll +++ b/.nojekyll @@ -1 +1 @@ -8eebf45a \ No newline at end of file +b19f3a89 \ No newline at end of file diff --git a/app_packages.html b/app_packages.html index 73b2ab0..7a63de9 100644 --- a/app_packages.html +++ b/app_packages.html @@ -378,7 +378,6 @@

Contents

  • Data (Chapter 7)
  • Launch (Chapter 8)
  • External files (Chapter 9)
  • -
  • Tests (Chapter 10)
  • @@ -514,7 +513,7 @@

    Packages (Chapter 3)

    03_proj-app is an ‘advanced’ package from the previous chapter

  • 04_description is a branch from 03_proj-app and adds the seven mandatory DESCRIPTION fields.

  • 05_rproj is a branch from 04_description and manually converts the shiny app project to a shiny app-package using the .Rproj file.

  • -
  • 06_create-package is a branch from 03_proj-app and creates a package using usethis::create_package()

  • +
  • 06a_create-package is a branch from 05_rproj and creates a package using usethis::create_package()

  • @@ -539,7 +538,7 @@

    Development (Chapter

    The code for Chapter 4 (Development) is stored in the following branch:

      -
    1. 06_devtools is a branch from the manually converted app-package in 05_rproj
    2. +
    3. 06b_devtools is a branch from the manually converted app-package in 05_rproj
    @@ -563,7 +562,7 @@

    Development (Chapter
    1
    -Always leave an empty line in the DESCRIPTION +Always leave an empty line in the DESCRIPTION
    @@ -590,20 +589,19 @@

    App-packages

    The following six chapter will continue with app-package development, emphasizing developing a shiny application within a package structure.

    In the following chapters, we’ll be using code from the moviesApp repository:

    -
    + -
    +
    -

    The code for the next section can be found in the moviesApp repository.

    -

    The main branch of moviesApp is identical to the 06_create-package branch from the moviesApp repository from the previous section:

    +

    The code for the next section can be found in the 06b_devtools branch of moviesApp repository.

    moviesApp/ 
       ├── DESCRIPTION
       ├── NAMESPACE
    @@ -696,16 +694,6 @@ 

    External files (C
  • system.file()

  • addResourcePath()

  • - -
    -

    Tests (Chapter 10)

    -

    Tests introduces the BDD functions and how to ‘scope’ the tests in your app-package before writing any code.

    -
      -
    • User specifications, features, functional requirements

    • -
    • Test fixtures and helpers

    • -
    • Module server function tests with testServer()

    • -
    • System tests with shinytest2

    • -
    diff --git a/comparisons.html b/comparisons.html index 9cf4e08..6526563 100644 --- a/comparisons.html +++ b/comparisons.html @@ -448,7 +448,7 @@

    1
    -Comparing identical objects +Comparing identical objects

    @@ -481,7 +481,7 @@

    1
    -Comparing different objects +Comparing different objects

    diff --git a/data.html b/data.html index fa9b040..31d2b5e 100644 --- a/data.html +++ b/data.html @@ -748,7 +748,7 @@

    Using movies

    1
    -The movies data from our package namespace +The movies data from our package namespace
    diff --git a/debugging.html b/debugging.html index db6cb68..ba5835b 100644 --- a/debugging.html +++ b/debugging.html @@ -485,12 +485,12 @@

    <
    1
    -observe() function scope
    +observe() function scope
    2
    -Call to browser() (called at the top of the observe() scope) +Call to browser() (called at the top of the observe() scope)

    @@ -581,12 +581,12 @@

    Debugging app func
    1
    -Observer scope
    +Observer scope
    2
    -Activate debugger +Activate debugger

    @@ -756,7 +756,7 @@

    Debugging modules

    1
    -Wrap browser() in observe() and place after the call to moduleServer() +Wrap browser() in observe() and place after the call to moduleServer()
    @@ -830,12 +830,12 @@

    Verify variable inp
    1
    -Variable inputs (from selected_vars)
    +Variable inputs (from selected_vars)
    2
    -inputs() for scatter_plot() +inputs() for scatter_plot()

    @@ -904,12 +904,12 @@

    Verify graph

    1
    -Observe scope
    +Observe scope
    2
    -Call to browser() +Call to browser()
    @@ -992,7 +992,7 @@
    1
    -Location of debugger in utility function +Location of debugger in utility function
    @@ -1050,17 +1050,17 @@

    Exploring code

    1
    -Observer scope
    +Observer scope
    2
    -Call to browser()
    +Call to browser()
    3
    -Additional module code omitted +Additional module code omitted
    @@ -1275,12 +1275,12 @@

    Debugging apps

    1
    -Optional label
    +Optional label
    2
    -Include the ns() for the inputId +Include the ns() for the inputId
    @@ -1301,17 +1301,17 @@

    Debugging apps

    1
    -Collect reactive values in module
    +Collect reactive values in module
    2
    -Print these values to the UI
    +Print these values to the UI
    3
    -Include all reactive objects +Include all reactive objects
    diff --git a/dependencies.html b/dependencies.html index 277e5b3..6044d85 100644 --- a/dependencies.html +++ b/dependencies.html @@ -533,7 +533,7 @@

    1
    -The man folder now contains the help (.Rd) files for the functions in R/ +The man folder now contains the help (.Rd) files for the functions in R/
    diff --git a/development.html b/development.html index 9ee5fc2..1384698 100644 --- a/development.html +++ b/development.html @@ -824,7 +824,7 @@

    -

    This section’s code is in the 06_devtools branch of moviesApp.

    +

    This section’s code is in the 06b_devtools branch of moviesApp.

    Check?

    diff --git a/document.html b/document.html index 370b335..5e9b27a 100644 --- a/document.html +++ b/document.html @@ -572,7 +572,7 @@

    1
    -Always leave at least one empty final line in your DESCRIPTION file. +Always leave at least one empty final line in your DESCRIPTION file.
    diff --git a/external.html b/external.html index 0f0ea6f..1dff858 100644 --- a/external.html +++ b/external.html @@ -528,7 +528,7 @@

    Our app-package file
    1
    -This is the location of the installed version of moviesApp +This is the location of the installed version of moviesApp
    @@ -717,17 +717,17 @@

    1
    -Prefix (or folder name) of installed location
    +Prefix (or folder name) of installed location
    2
    -Path to installed package files
    +Path to installed package files
    3
    -Reference to installed package image file +Reference to installed package image file
    @@ -873,22 +873,22 @@

    1
    -Include inst/www resources
    +Include inst/www resources
    2
    -Standard fluidPage()
    +Standard fluidPage()
    3
    -bslib layout
    +bslib layout
    4
    -Reference to alternate image (bootstrap.png) +Reference to alternate image (bootstrap.png)
    @@ -1094,12 +1094,12 @@
    Modules
    1
    -Alternate help text for ggplot2movies data
    +Alternate help text for ggplot2movies data
    2
    -Check-box to remove missing values +Check-box to remove missing values
    @@ -1164,17 +1164,17 @@
    Modules
    1
    -Build reactive data based on missing checkbox input
    +Build reactive data based on missing checkbox input
    2
    -Bind missing input to update when UI changes
    +Bind missing input to update when UI changes
    3
    -Bind plot output to update with variable inputs and ‘missing’ checkbox output +Bind plot output to update with variable inputs and ‘missing’ checkbox output
    @@ -1234,21 +1234,21 @@
    UI and server
    1
    -Add alternate path to include image file +Add alternate path to include image file
    2
    -Development variable input module (UI)
    +Development variable input module (UI)
    3
    -Refer to alternate image
    +Refer to alternate image
    4
    -Development scatter-plot display module (UI) +Development scatter-plot display module (UI)
    @@ -1268,11 +1268,11 @@
    UI and server
    1
    -mod_var_input_server() exported from moviesApp’s R/ folder +mod_var_input_server() exported from moviesApp’s R/ folder
    2
    -Defined in dev/inst/app.R +Defined in dev/inst/app.R
    diff --git a/launch.html b/launch.html index 49e3c2c..fb410ad 100644 --- a/launch.html +++ b/launch.html @@ -529,17 +529,17 @@

    1
    -Install packages (if needed)
    +Install packages (if needed)
    2
    -Load package
    +Load package
    3
    -Call standalone app function +Call standalone app function
    @@ -600,7 +600,7 @@

    1
    -The movies_app() standalone function +The movies_app() standalone function
    @@ -739,12 +739,12 @@

    <
    1
    -appDir is the first argument of runApp()
    +appDir is the first argument of runApp()
    2
    -A shiny app object +A shiny app object
    @@ -920,12 +920,12 @@

    1
    -Build the shiny app object with movies_ui and movies_server
    +Build the shiny app object with movies_ui and movies_server
    2
    -Include options list +Include options list
    @@ -1022,17 +1022,17 @@

    Updated
    1
    -Check if interactive (Workbench) launch
    +Check if interactive (Workbench) launch
    2
    -Set shinyViewerType option with display_type()
    +Set shinyViewerType option with display_type()
    3
    -Launch app +Launch app
    @@ -1203,22 +1203,22 @@

    1
    -Turn off loadSupport()
    +Turn off loadSupport()
    2
    -Define non-interactive behaviors
    +Define non-interactive behaviors
    3
    -Define interactive behaviors
    +Define interactive behaviors
    4
    -Launch app (with options) +Launch app (with options)
    diff --git a/packages.html b/packages.html index 9536723..e033e0d 100644 --- a/packages.html +++ b/packages.html @@ -670,7 +670,7 @@

    1
    -Leave an empty final line in the DESCRIPTION +Leave an empty final line in the DESCRIPTION
    @@ -1119,7 +1119,7 @@

    IDE arguments

    1
    -Leave an empty final line in the DESCRIPTION +Leave an empty final line in the DESCRIPTION
    @@ -1131,7 +1131,7 @@

    IDE arguments

    -

    This section’s code is in the 06_create-package branch of moviesApp.

    +

    This section’s code is in the 06b_devtools branch of moviesApp.

    diff --git a/search.json b/search.json index 348db11..282755d 100644 --- a/search.json +++ b/search.json @@ -298,7 +298,7 @@ "href": "packages.html#creating-shiny-app-packages-with-create_package", "title": "Packages", "section": "Creating Shiny app-packages with create_package()", - "text": "Creating Shiny app-packages with create_package()\nThe Posit documentation lists the following way(s) to create R packages:8\n\n\nCall usethis::create_package().\nIn RStudio, do File > New Project > New Directory > R Package. This ultimately calls usethis::create_package(), so really there’s just one way.\n\n\ncreate_package() is a great option if you’re looking for a way to quickly create or convert your Shiny project into a Shiny app-package. In the following sections I’ll cover some suggestions for using create_package().9\n\nNew Shiny app-packages\nIf you haven’t written any code and want to create a new Shiny app-package, create_package() is the quickest way to get started.\nFirst, install devtools:\n\ninstall.packages(\"devtools\")\nlibrary(devtools)\n\ndevtools automatically loads usethis\nLoading required package: usethis\nAssuming your current working directory is where you want your new Shiny app-package, call usethis::create_package() with the path argument set to getwd()\n\nusethis::create_package(path = getwd())\n\nThis call launches a series of actions:\n\nFirst, the active project is set to whatever was given to the path argument.\n✔ Setting active project to 'path/to/newApp'\nThe R/ folder and DESCRIPTION/ file are created:\n✔ Creating 'R/'\n✔ Writing 'DESCRIPTION'\nThe NAMESPACE and .Rproj files are created:\n✔ Writing 'NAMESPACE'\n✔ Writing 'newApp.Rproj'\nThe .Rproj is added to the .Rbuildignore file, the .Rproj.user folder is added to the .gitignore and .Rbuildignore files.\n✔ Adding '^newApp\\\\.Rproj$' to '.Rbuildignore'\n✔ Adding '.Rproj.user' to '.gitignore'\n✔ Adding '^\\\\.Rproj\\\\.user$' to '.Rbuildignore'\nA new session is opened from the new .Rproj file:\n✔ Opening 'path/to/newApp/' in new RStudio session\n\nWhen the new session opens, newApp has the following contents:\n\nnewApp/\n ├── .Rbuildignore\n ├── .Rproj.user/\n ├── .gitignore\n ├── DESCRIPTION\n ├── NAMESPACE\n ├── R/\n └── newApp.Rproj\n\nYou’re now free to develop newApp. Store and document any .R files in the R/ folder, edit the DESCRIPTION file with details about the application, read through R Packages and Mastering Shiny, and add the Shiny code to complete your Shiny app-package.\n\n\nConverting existing Shiny projects\nIf you already have a Shiny app project that needs to be converted into a Shiny app-package (like the app files stored in the 03_proj-app branch), you can also use create_package(path = getwd()) in your root folder, but I recommend using the following arguments:\n\nDESCRIPTION arguments\n\nfields: these are arguments passed to usethis::use_description(). If the fields argument is empty, a boilerplate DESCRIPTION file is created (similar to this one).\n\nThese boilerplate fields in the DESCRIPTION work, but I’ve found some of the fields are unnecessary (i.e., I’ve never needed Authors@R: or ORCID) and inevitably require revision, so I’d prefer to handle this during the creation process (and remove the risk of forgetting to change it later).\nAll fields should be passed in a list() as field = 'value' pairs.\n\n\nusethis::use_description(\n list(Package = 'moviesApp',\n Version = '0.0.0.9000',\n Title = 'movies app',\n Description = 'A movie-review Shiny application.',\n \"Authors@R\" = NULL,\n Author = utils::person(\n given = \"John\", \n family = \"Smith\", \n role = c(\"aut\", \"cre\")),\n Maintainer = utils::person(\n given = \"John\", \n family = \"Smith\",\n email = \"John.Smith@email.io\"),\n License = \"GPL-3\"))\n\n\nA few fields require specially formatted values (see the utils::person() examples below).\n\nutils::person(\"John\", \"Smith\", \n email = \"John.Smith@email.io\", \n role = c(\"aut\", \"cre\"))\n\n[1] \"John Smith <John.Smith@email.io> [aut, cre]\"\n\n\n\nTwo additional arguments from use_description() are passed to create_package():\n\ncheck_name: verifies your Shiny app-package name is valid for CRAN, so we can set this to FALSE (unless you’re planning on submitting to CRAN)\nroxygen2: is TRUE by default and adds the fields required to use roxygen2 (which I won’t cover here because we’ll cover documentation in-depth in a future chapter).\n\n\n\n\n\n\n\n\nWARNING: Don’t use usethis::create_package('.')!\n\n\n\n\n\n\nWhen converting your existing Shiny app project into a Shiny app-package with usethis::create_package(), don’t use '.' in the path argument:\nusethis::create_package('.')\nThis will return the following warning about creating nested projects, and ask if you want to proceed anyway:\nNew project 'moviesApp' is nested inside an existing project\n'./', which is rarely a good idea. If this is unexpected, \nthe here package has a function,\n`here::dr_here()` that reveals why './' is regarded as a\nproject.\n \nDo you want to create anyway?\n\n1: Yes\n2: No way\n3: Not now\nWe can avoid this warning altogether by passing getwd() to the path argument, so I recommend cancelling the project creation:\nSelection: 2\nError: Cancelling project creation.\n\n\n\n\n\n\nIDE arguments\n\nrstudio: adds the necessary Build Tools fields in the .Rproj file (leave as TRUE)\nopen: can be set to FALSE because we don’t need RStudio/Posit Workbench to open in a new session\n\n\nusethis::create_package(\n path = getwd(),\n fields = list(Package = 'moviesApp',\n Version = '0.0.0.9000',\n Title = 'movies app',\n Description = 'A movie-review Shiny application.',\n \"Authors@R\" = NULL,\n Author = utils::person(\n given = \"John\", \n family = \"Smith\", \n email = \"John.Smith@email.io\", \n role = c(\"aut\", \"cre\")),\n Maintainer = utils::person(\n given = \"John\", \n family = \"Smith\",\n email = \"John.Smith@email.io\"),\n License = \"GPL-3\"),\n roxygen = TRUE,\n check_name = FALSE, \n rstudio = TRUE,\n open = FALSE)\n\nAfter running usethis::create_package() with the arguments above, the IDE will present us with a few prompts to confirm:\nOverwrite pre-existing file 'DESCRIPTION'?\nOverwrite pre-existing file 'moviesApp.Rproj'?\nThe Shiny app-package structure is below:\n\n├── DESCRIPTION\n├── NAMESPACE\n├── R\n│ ├── mod_scatter_display.R\n│ ├── mod_var_input.R\n│ └── utils.R\n├── README.md\n├── app.R\n├── movies.RData\n├── moviesApp.Rproj\n└── www\n └── Shiny.png\n\n3 directories, 10 files\n\nThe DESCRIPTION file (shown below) has a few additional fields (Encoding, Roxygen, and RoxygenNote) we didn’t include when we converted moviesApp above, but we will cover these in the upcoming chapters.\n\nPackage: moviesApp\nTitle: movies app\nVersion: 0.0.0.9000\nAuthor: John Smith <John.Smith@email.io> [aut, cre]\nMaintainer: John Smith <John.Smith@email.io>\nDescription: A movie-review Shiny application.\nLicense: GPL-3\nEncoding: UTF-8\nRoxygen: list(markdown = TRUE)\nRoxygenNote: 7.2.3\n1\n\n\n1\n\nLeave an empty final line in the DESCRIPTION\n\n\n\n\n\n\n\n\n\n\n\nThis section’s code is in the 06_create-package branch of moviesApp." + "text": "Creating Shiny app-packages with create_package()\nThe Posit documentation lists the following way(s) to create R packages:8\n\n\nCall usethis::create_package().\nIn RStudio, do File > New Project > New Directory > R Package. This ultimately calls usethis::create_package(), so really there’s just one way.\n\n\ncreate_package() is a great option if you’re looking for a way to quickly create or convert your Shiny project into a Shiny app-package. In the following sections I’ll cover some suggestions for using create_package().9\n\nNew Shiny app-packages\nIf you haven’t written any code and want to create a new Shiny app-package, create_package() is the quickest way to get started.\nFirst, install devtools:\n\ninstall.packages(\"devtools\")\nlibrary(devtools)\n\ndevtools automatically loads usethis\nLoading required package: usethis\nAssuming your current working directory is where you want your new Shiny app-package, call usethis::create_package() with the path argument set to getwd()\n\nusethis::create_package(path = getwd())\n\nThis call launches a series of actions:\n\nFirst, the active project is set to whatever was given to the path argument.\n✔ Setting active project to 'path/to/newApp'\nThe R/ folder and DESCRIPTION/ file are created:\n✔ Creating 'R/'\n✔ Writing 'DESCRIPTION'\nThe NAMESPACE and .Rproj files are created:\n✔ Writing 'NAMESPACE'\n✔ Writing 'newApp.Rproj'\nThe .Rproj is added to the .Rbuildignore file, the .Rproj.user folder is added to the .gitignore and .Rbuildignore files.\n✔ Adding '^newApp\\\\.Rproj$' to '.Rbuildignore'\n✔ Adding '.Rproj.user' to '.gitignore'\n✔ Adding '^\\\\.Rproj\\\\.user$' to '.Rbuildignore'\nA new session is opened from the new .Rproj file:\n✔ Opening 'path/to/newApp/' in new RStudio session\n\nWhen the new session opens, newApp has the following contents:\n\nnewApp/\n ├── .Rbuildignore\n ├── .Rproj.user/\n ├── .gitignore\n ├── DESCRIPTION\n ├── NAMESPACE\n ├── R/\n └── newApp.Rproj\n\nYou’re now free to develop newApp. Store and document any .R files in the R/ folder, edit the DESCRIPTION file with details about the application, read through R Packages and Mastering Shiny, and add the Shiny code to complete your Shiny app-package.\n\n\nConverting existing Shiny projects\nIf you already have a Shiny app project that needs to be converted into a Shiny app-package (like the app files stored in the 03_proj-app branch), you can also use create_package(path = getwd()) in your root folder, but I recommend using the following arguments:\n\nDESCRIPTION arguments\n\nfields: these are arguments passed to usethis::use_description(). If the fields argument is empty, a boilerplate DESCRIPTION file is created (similar to this one).\n\nThese boilerplate fields in the DESCRIPTION work, but I’ve found some of the fields are unnecessary (i.e., I’ve never needed Authors@R: or ORCID) and inevitably require revision, so I’d prefer to handle this during the creation process (and remove the risk of forgetting to change it later).\nAll fields should be passed in a list() as field = 'value' pairs.\n\n\nusethis::use_description(\n list(Package = 'moviesApp',\n Version = '0.0.0.9000',\n Title = 'movies app',\n Description = 'A movie-review Shiny application.',\n \"Authors@R\" = NULL,\n Author = utils::person(\n given = \"John\", \n family = \"Smith\", \n role = c(\"aut\", \"cre\")),\n Maintainer = utils::person(\n given = \"John\", \n family = \"Smith\",\n email = \"John.Smith@email.io\"),\n License = \"GPL-3\"))\n\n\nA few fields require specially formatted values (see the utils::person() examples below).\n\nutils::person(\"John\", \"Smith\", \n email = \"John.Smith@email.io\", \n role = c(\"aut\", \"cre\"))\n\n[1] \"John Smith <John.Smith@email.io> [aut, cre]\"\n\n\n\nTwo additional arguments from use_description() are passed to create_package():\n\ncheck_name: verifies your Shiny app-package name is valid for CRAN, so we can set this to FALSE (unless you’re planning on submitting to CRAN)\nroxygen2: is TRUE by default and adds the fields required to use roxygen2 (which I won’t cover here because we’ll cover documentation in-depth in a future chapter).\n\n\n\n\n\n\n\n\nWARNING: Don’t use usethis::create_package('.')!\n\n\n\n\n\n\nWhen converting your existing Shiny app project into a Shiny app-package with usethis::create_package(), don’t use '.' in the path argument:\nusethis::create_package('.')\nThis will return the following warning about creating nested projects, and ask if you want to proceed anyway:\nNew project 'moviesApp' is nested inside an existing project\n'./', which is rarely a good idea. If this is unexpected, \nthe here package has a function,\n`here::dr_here()` that reveals why './' is regarded as a\nproject.\n \nDo you want to create anyway?\n\n1: Yes\n2: No way\n3: Not now\nWe can avoid this warning altogether by passing getwd() to the path argument, so I recommend cancelling the project creation:\nSelection: 2\nError: Cancelling project creation.\n\n\n\n\n\n\nIDE arguments\n\nrstudio: adds the necessary Build Tools fields in the .Rproj file (leave as TRUE)\nopen: can be set to FALSE because we don’t need RStudio/Posit Workbench to open in a new session\n\n\nusethis::create_package(\n path = getwd(),\n fields = list(Package = 'moviesApp',\n Version = '0.0.0.9000',\n Title = 'movies app',\n Description = 'A movie-review Shiny application.',\n \"Authors@R\" = NULL,\n Author = utils::person(\n given = \"John\", \n family = \"Smith\", \n email = \"John.Smith@email.io\", \n role = c(\"aut\", \"cre\")),\n Maintainer = utils::person(\n given = \"John\", \n family = \"Smith\",\n email = \"John.Smith@email.io\"),\n License = \"GPL-3\"),\n roxygen = TRUE,\n check_name = FALSE, \n rstudio = TRUE,\n open = FALSE)\n\nAfter running usethis::create_package() with the arguments above, the IDE will present us with a few prompts to confirm:\nOverwrite pre-existing file 'DESCRIPTION'?\nOverwrite pre-existing file 'moviesApp.Rproj'?\nThe Shiny app-package structure is below:\n\n├── DESCRIPTION\n├── NAMESPACE\n├── R\n│ ├── mod_scatter_display.R\n│ ├── mod_var_input.R\n│ └── utils.R\n├── README.md\n├── app.R\n├── movies.RData\n├── moviesApp.Rproj\n└── www\n └── Shiny.png\n\n3 directories, 10 files\n\nThe DESCRIPTION file (shown below) has a few additional fields (Encoding, Roxygen, and RoxygenNote) we didn’t include when we converted moviesApp above, but we will cover these in the upcoming chapters.\n\nPackage: moviesApp\nTitle: movies app\nVersion: 0.0.0.9000\nAuthor: John Smith <John.Smith@email.io> [aut, cre]\nMaintainer: John Smith <John.Smith@email.io>\nDescription: A movie-review Shiny application.\nLicense: GPL-3\nEncoding: UTF-8\nRoxygen: list(markdown = TRUE)\nRoxygenNote: 7.2.3\n1\n\n\n1\n\nLeave an empty final line in the DESCRIPTION\n\n\n\n\n\n\n\n\n\n\n\nThis section’s code is in the 06b_devtools branch of moviesApp." }, { "objectID": "packages.html#recap", @@ -333,7 +333,7 @@ "href": "development.html#package-development-habits", "title": "Development", "section": "Package development habits", - "text": "Package development habits\nThe differences between developing an R package and a shiny app can be boiled down to a handful habits, each of which calls a devtools function:\n\n\nI’ll use bold to indicate each devtools habit and accompanying function.\n\nLoad all the functions and data in your app-package with load_all()\nDocument the app-package functions and data with document()\nInstall the app-package with install()\n\nIn the sections below, I’ll cover each function and my opinion about how it should be used when your shiny app becomes an app-package.3\n\n\n\n\n\n\nKeyboard shortcuts\n\n\n\n\n\n\nI strongly recommend using the keyboard shortcuts for each devtools function. Shortcuts reduce typing and bundle all those keystrokes into a single action. They also create a kind of ‘muscle memory’ for each step.\n\n\n\n\n\nLoad\nInstall devtools\n\ninstall.packages(\"devtools\")\nlibrary(devtools)\n\nusethis is automatically loaded/attached with devtools.\nLoading required package: usethis\n\n‘load_all() removes friction from the development workflow and eliminates the temptation to use workarounds that often lead to mistakes around namespace and dependency management’ - Benefits of load_all(), R Packages, 2ed\n\nload_all() is the most common devtools function we’ll use during development because we should load the package when anything changes in the R/ folder.\n\n\n\n\n\n\n\n\nCtrl/Cmd + Shift + L\n\n\n\n\n\n\n\n\ndevtools::load_all()\n\nUsing load_all() is similar to calling library(moviesApp) because it loads the code in R/ along with any data files. load_all() is also designed for iteration (unlike using source()), and when it’s successful, the output is a single informative message:\nℹ Loading moviesApp\n\n\nDocument\nThe document() function from devtools serves two purposes:\n\nWriting the package NAMESPACE file\nCreates the help files in the man/ folder\n\ndevtools is smart enough to recognize the first time document() is called, so when I initially run it in the Console, it prompts me that the roxygen2 version needs to be set in the DESCRIPTION file:\n\n\n\n\n\n\n\n\nCtrl/Cmd + Shift + D\n\n\n\n\n\n\n\n\ndevtools::document()\n\nℹ Updating moviesApp documentation\nFirst time using roxygen2. Upgrading automatically...\nSetting `RoxygenNote` to \"7.2.3\"\ndevtools relies on roxygen2 for package documentation, so the RoxygenNote field is required in the DESCRIPTION. You may have noticed calling document() also calls load_all(), which scans the loaded package contents for special documentation syntax before writing the NAMESPACE file (we’ll cover the NAMESPACE in the chapter on Dependencies).\nℹ Loading moviesApp\nWriting NAMESPACE\nIf we open the NAMESPACE file, we see it’s empty (and that we shouldn’t edit this file by hand).\n\n\n\n\n\n(a) NAMESPACE\n\n\nFigure 4.1: Initial NAMESPACE file\n\n\nThe last few output lines warn us to include the Encoding field in the DESCRIPTION. devtools won’t automatically add Encoding (like it did with RoxygenNote above), so we’ll need to add it to the DESCRIPTION file manually:\nWarning message:\nroxygen2 requires Encoding: \"UTF-8\"\nℹ Current encoding is NA \n\nPackage: moviesApp\nVersion: 0.0.0.9000\nType: Package\nTitle: movies app\nDescription: A movies data shiny application.\nAuthor: John Smith [aut, cre]\nMaintainer: John Smith <John.Smith@email.io>\nLicense: GPL-3\nRoxygenNote: 7.2.3\n1Encoding: UTF-8\n2\n\n\n1\n\nThe Encoding value shouldn’t include quotes like the warning message above (i.e., UTF-8)\n\n\n2\n\nAlways leave an empty final line in the DESCRIPTION\n\n\n\n\nAfter adding the required fields to the DESCRIPTION file,4 we’ll document() the package again using the keyboard shortcut:\nIn the Build pane, we see the following:\n==> devtools::document(roclets = c('rd', 'collate', 'namespace'))\n\nℹ Updating moviesApp documentation\nℹ Loading moviesApp\nDocumentation completed\nDocument the package whenever changes are made to any roxygen2 syntax (or settings).\n\n\nInstall\nThe final package development habit to adopt is regularly installing the package with devtools::install().\n\n\n\n\n\n\n\n\nCtrl/Cmd + Shift + B\n\n\n\n\n\n\n\n\ndevtools::install()\n\ninstall() will prompt the following output in the Build pane:\n==> R CMD INSTALL --preclean --no-multiarch --with-keep.source moviesApp\n\n* installing to library ‘/path/to/local/install/moviesApp-090c61fc/R-4.2/x86_64-apple-darwin17.0’\n* installing *source* package ‘moviesApp’ ...\n** using staged installation\n** R\n** byte-compile and prepare package for lazy loading\nNo man pages found in package ‘moviesApp’ \n** help\n*** installing help indices\n** building package indices\n** testing if installed package can be loaded from temporary location\n** testing if installed package can be loaded from final location\n** testing if installed package keeps a record of temporary installation path\n* DONE (moviesApp)\nThere are a few connections worth making in this initial install() output:\n\nThe first line in the output should look familiar–we saw both of these settings in the moviesApp.Rproj file from the previous chapter\nPackageInstallArgs: --no-multiarch --with-keep.source\nNo man pages found in package 'moviesApp' tells us none of the code in R/ has adequately been documented (which we’ll cover in the roxygen2 chapter)\ninstall() attempts to install the package from the *source* files and a ‘bundle’ or source tarball file (i.e., .tar.gz)\nhelp files are built, along with other documentation (like vignettes)\nDONE (moviesApp) means moviesApp was successfully installed!\n\nInstall a package after the initial setup, after major changes to the code, documentation, or dependencies, and before committing or sharing.\n\n\n\n\n\n\n\nThis section’s code is in the 06_devtools branch of moviesApp.\n\n\nCheck?\ndevtools::check() performs a series of checks to ensure a package meets the standards set by CRAN. You can consider check() as a ‘quality control’ function for documentation, NAMESPACE dependencies, unnecessary or non-standard folders and files, etc. R Packages recommends using check() often, but I agree with the advice in Mastering Shiny on using check() with app-packages,\n\n‘I don’t recommend that you [call devtools::check()] the first time, the second time, or even the third time you try out the package structure. Instead, I recommend that you get familiar with the basic structure and workflow before you take the next step to make a fully compliant package.’\n\nHowever, I’ve included an example of running check() on moviesApp in the callout box below to demonstrate how it works.\n\n\n\n\n\n\nRunning devtools::check()\n\n\n\n\n\n\ndevtools::check()\n\nThe output from check() can be rather lengthy (it’s pretty comprehensive!), and it provides feedback on each item in the form of a note (N), warning (W), or error (E).\n==> devtools::check()\n\nDuration: 15.3s\n\nN checking top-level files\n Non-standard files/directories found at top level:\n ‘app.R’ ‘movies.RData’\n\nW checking dependencies in R code ...\n '::' or ':::' imports not declared from:\n ‘ggplot2’ ‘shiny’ ‘stringr’\n\nN checking R code for possible problems (3.1s)\n mod_scatter_display_server : <anonymous>: no visible binding for global\n variable ‘movies’\n scatter_plot: no visible binding for global variable ‘.data’\n Undefined global functions or variables:\n .data movies\n\nW checking for missing documentation entries ...\n Undocumented code objects:\n ‘mod_scatter_display_server’ ‘mod_scatter_display_ui’\n ‘mod_var_input_server’ ‘mod_var_input_ui’ ‘scatter_plot’\n All user-level objects in a package should have documentation entries.\n See chapter ‘Writing R documentation files’ in the ‘Writing R\n Extensions’ manual.\n\n0 errors ✔ | 2 warnings ✖ | 2 notes ✖\nA summary of each item is below:\n\nchecking top-level files: This note refers to the two non-standard (i.e., not typically found in an R package) files, app.R and movies.RData.\nchecking dependencies in R code: This warning tells I need to namespace functions from add-on packages (in this case, ggplot2, shiny, and stringr)\nchecking R code for possible problems: This item refers to the call to load the movies data in the module server function (mod_scatter_display_server).\nchecking for missing documentation entries: This is warning me that the module functions aren’t properly documented and refers me to the official R documentation.\n\nEach of these items is also printed under the ── R CMD check results heading:\nDuration: 15.3s\n\n❯ checking dependencies in R code ... WARNING\n '::' or ':::' imports not declared from:\n ‘ggplot2’ ‘shiny’ ‘stringr’\n\n❯ checking for missing documentation entries ... WARNING\n Undocumented code objects:\n ‘mod_scatter_display_server’ ‘mod_scatter_display_ui’\n ‘mod_var_input_server’ ‘mod_var_input_ui’ ‘scatter_plot’\n All user-level objects in a package should have documentation entries.\n See chapter ‘Writing R documentation files’ in the ‘Writing R\n Extensions’ manual.\n\n❯ checking top-level files ... NOTE\n Non-standard files/directories found at top level:\n ‘app.R’ ‘movies.RData’\n\n❯ checking R code for possible problems ... NOTE\n mod_scatter_display_server : <anonymous>: no visible binding for global\n variable ‘movies’\n scatter_plot: no visible binding for global variable ‘.data’\n Undefined global functions or variables:\n .data movies\n\n0 errors ✔ | 2 warnings ✖ | 2 notes ✖\nIf you’re submitting your app-package to CRAN (or want to use check() for other reasons), follow the suggested workflow for check():\n\nThe workflow for checking a package is simple, but tedious:\n\nRun devtools::check() or press Shift + Ctrl/Cmd + E\nFix the first problem.\nRepeat until there are no more problems.’\n\n\nI’ve found a good habit for when to check() to be:\nAfter adding a bug fix or feature, check a package and keep any notes, warnings, or errors from accumulating.\n\n\n\n\n\nRecap\nCreating an app-package involves adopting some new devtools habits, and the initial contents of moviesApp hopefully helped demonstrate the purpose of each function.\n\n\n\n\n\n\nRecap: Package development habits\n\n\n\n\n\n\nAfter installing and loading devtools:\n\nLoad the package whenever changes occur in the R/ folder.\n\nCtrl/Cmd + Shift + L load all the code in the package.\n\nDocument the package whenever changes are made to any roxygen2 syntax (or settings).\n\nCtrl/Cmd + Shift + D record the documentation and dependencies.\n\nInstall the package after the initial setup, after major changes to the code, documentation, or dependencies, and before committing or sharing.\n\nCtrl/Cmd + Shift + B confirms the package can be installed.\n\n\nHabits require repetition to develop, and I hope the workflow above can be applied to your shiny app-packages, provided you’re using devtools and Posit workbench.\n\n\n\n\nThe following section will cover documenting functions with roxygen2" + "text": "Package development habits\nThe differences between developing an R package and a shiny app can be boiled down to a handful habits, each of which calls a devtools function:\n\n\nI’ll use bold to indicate each devtools habit and accompanying function.\n\nLoad all the functions and data in your app-package with load_all()\nDocument the app-package functions and data with document()\nInstall the app-package with install()\n\nIn the sections below, I’ll cover each function and my opinion about how it should be used when your shiny app becomes an app-package.3\n\n\n\n\n\n\nKeyboard shortcuts\n\n\n\n\n\n\nI strongly recommend using the keyboard shortcuts for each devtools function. Shortcuts reduce typing and bundle all those keystrokes into a single action. They also create a kind of ‘muscle memory’ for each step.\n\n\n\n\n\nLoad\nInstall devtools\n\ninstall.packages(\"devtools\")\nlibrary(devtools)\n\nusethis is automatically loaded/attached with devtools.\nLoading required package: usethis\n\n‘load_all() removes friction from the development workflow and eliminates the temptation to use workarounds that often lead to mistakes around namespace and dependency management’ - Benefits of load_all(), R Packages, 2ed\n\nload_all() is the most common devtools function we’ll use during development because we should load the package when anything changes in the R/ folder.\n\n\n\n\n\n\n\n\nCtrl/Cmd + Shift + L\n\n\n\n\n\n\n\n\ndevtools::load_all()\n\nUsing load_all() is similar to calling library(moviesApp) because it loads the code in R/ along with any data files. load_all() is also designed for iteration (unlike using source()), and when it’s successful, the output is a single informative message:\nℹ Loading moviesApp\n\n\nDocument\nThe document() function from devtools serves two purposes:\n\nWriting the package NAMESPACE file\nCreates the help files in the man/ folder\n\ndevtools is smart enough to recognize the first time document() is called, so when I initially run it in the Console, it prompts me that the roxygen2 version needs to be set in the DESCRIPTION file:\n\n\n\n\n\n\n\n\nCtrl/Cmd + Shift + D\n\n\n\n\n\n\n\n\ndevtools::document()\n\nℹ Updating moviesApp documentation\nFirst time using roxygen2. Upgrading automatically...\nSetting `RoxygenNote` to \"7.2.3\"\ndevtools relies on roxygen2 for package documentation, so the RoxygenNote field is required in the DESCRIPTION. You may have noticed calling document() also calls load_all(), which scans the loaded package contents for special documentation syntax before writing the NAMESPACE file (we’ll cover the NAMESPACE in the chapter on Dependencies).\nℹ Loading moviesApp\nWriting NAMESPACE\nIf we open the NAMESPACE file, we see it’s empty (and that we shouldn’t edit this file by hand).\n\n\n\n\n\n(a) NAMESPACE\n\n\nFigure 4.1: Initial NAMESPACE file\n\n\nThe last few output lines warn us to include the Encoding field in the DESCRIPTION. devtools won’t automatically add Encoding (like it did with RoxygenNote above), so we’ll need to add it to the DESCRIPTION file manually:\nWarning message:\nroxygen2 requires Encoding: \"UTF-8\"\nℹ Current encoding is NA \n\nPackage: moviesApp\nVersion: 0.0.0.9000\nType: Package\nTitle: movies app\nDescription: A movies data shiny application.\nAuthor: John Smith [aut, cre]\nMaintainer: John Smith <John.Smith@email.io>\nLicense: GPL-3\nRoxygenNote: 7.2.3\n1Encoding: UTF-8\n2\n\n\n1\n\nThe Encoding value shouldn’t include quotes like the warning message above (i.e., UTF-8)\n\n\n2\n\nAlways leave an empty final line in the DESCRIPTION\n\n\n\n\nAfter adding the required fields to the DESCRIPTION file,4 we’ll document() the package again using the keyboard shortcut:\nIn the Build pane, we see the following:\n==> devtools::document(roclets = c('rd', 'collate', 'namespace'))\n\nℹ Updating moviesApp documentation\nℹ Loading moviesApp\nDocumentation completed\nDocument the package whenever changes are made to any roxygen2 syntax (or settings).\n\n\nInstall\nThe final package development habit to adopt is regularly installing the package with devtools::install().\n\n\n\n\n\n\n\n\nCtrl/Cmd + Shift + B\n\n\n\n\n\n\n\n\ndevtools::install()\n\ninstall() will prompt the following output in the Build pane:\n==> R CMD INSTALL --preclean --no-multiarch --with-keep.source moviesApp\n\n* installing to library ‘/path/to/local/install/moviesApp-090c61fc/R-4.2/x86_64-apple-darwin17.0’\n* installing *source* package ‘moviesApp’ ...\n** using staged installation\n** R\n** byte-compile and prepare package for lazy loading\nNo man pages found in package ‘moviesApp’ \n** help\n*** installing help indices\n** building package indices\n** testing if installed package can be loaded from temporary location\n** testing if installed package can be loaded from final location\n** testing if installed package keeps a record of temporary installation path\n* DONE (moviesApp)\nThere are a few connections worth making in this initial install() output:\n\nThe first line in the output should look familiar–we saw both of these settings in the moviesApp.Rproj file from the previous chapter\nPackageInstallArgs: --no-multiarch --with-keep.source\nNo man pages found in package 'moviesApp' tells us none of the code in R/ has adequately been documented (which we’ll cover in the roxygen2 chapter)\ninstall() attempts to install the package from the *source* files and a ‘bundle’ or source tarball file (i.e., .tar.gz)\nhelp files are built, along with other documentation (like vignettes)\nDONE (moviesApp) means moviesApp was successfully installed!\n\nInstall a package after the initial setup, after major changes to the code, documentation, or dependencies, and before committing or sharing.\n\n\n\n\n\n\n\nThis section’s code is in the 06b_devtools branch of moviesApp.\n\n\nCheck?\ndevtools::check() performs a series of checks to ensure a package meets the standards set by CRAN. You can consider check() as a ‘quality control’ function for documentation, NAMESPACE dependencies, unnecessary or non-standard folders and files, etc. R Packages recommends using check() often, but I agree with the advice in Mastering Shiny on using check() with app-packages,\n\n‘I don’t recommend that you [call devtools::check()] the first time, the second time, or even the third time you try out the package structure. Instead, I recommend that you get familiar with the basic structure and workflow before you take the next step to make a fully compliant package.’\n\nHowever, I’ve included an example of running check() on moviesApp in the callout box below to demonstrate how it works.\n\n\n\n\n\n\nRunning devtools::check()\n\n\n\n\n\n\ndevtools::check()\n\nThe output from check() can be rather lengthy (it’s pretty comprehensive!), and it provides feedback on each item in the form of a note (N), warning (W), or error (E).\n==> devtools::check()\n\nDuration: 15.3s\n\nN checking top-level files\n Non-standard files/directories found at top level:\n ‘app.R’ ‘movies.RData’\n\nW checking dependencies in R code ...\n '::' or ':::' imports not declared from:\n ‘ggplot2’ ‘shiny’ ‘stringr’\n\nN checking R code for possible problems (3.1s)\n mod_scatter_display_server : <anonymous>: no visible binding for global\n variable ‘movies’\n scatter_plot: no visible binding for global variable ‘.data’\n Undefined global functions or variables:\n .data movies\n\nW checking for missing documentation entries ...\n Undocumented code objects:\n ‘mod_scatter_display_server’ ‘mod_scatter_display_ui’\n ‘mod_var_input_server’ ‘mod_var_input_ui’ ‘scatter_plot’\n All user-level objects in a package should have documentation entries.\n See chapter ‘Writing R documentation files’ in the ‘Writing R\n Extensions’ manual.\n\n0 errors ✔ | 2 warnings ✖ | 2 notes ✖\nA summary of each item is below:\n\nchecking top-level files: This note refers to the two non-standard (i.e., not typically found in an R package) files, app.R and movies.RData.\nchecking dependencies in R code: This warning tells I need to namespace functions from add-on packages (in this case, ggplot2, shiny, and stringr)\nchecking R code for possible problems: This item refers to the call to load the movies data in the module server function (mod_scatter_display_server).\nchecking for missing documentation entries: This is warning me that the module functions aren’t properly documented and refers me to the official R documentation.\n\nEach of these items is also printed under the ── R CMD check results heading:\nDuration: 15.3s\n\n❯ checking dependencies in R code ... WARNING\n '::' or ':::' imports not declared from:\n ‘ggplot2’ ‘shiny’ ‘stringr’\n\n❯ checking for missing documentation entries ... WARNING\n Undocumented code objects:\n ‘mod_scatter_display_server’ ‘mod_scatter_display_ui’\n ‘mod_var_input_server’ ‘mod_var_input_ui’ ‘scatter_plot’\n All user-level objects in a package should have documentation entries.\n See chapter ‘Writing R documentation files’ in the ‘Writing R\n Extensions’ manual.\n\n❯ checking top-level files ... NOTE\n Non-standard files/directories found at top level:\n ‘app.R’ ‘movies.RData’\n\n❯ checking R code for possible problems ... NOTE\n mod_scatter_display_server : <anonymous>: no visible binding for global\n variable ‘movies’\n scatter_plot: no visible binding for global variable ‘.data’\n Undefined global functions or variables:\n .data movies\n\n0 errors ✔ | 2 warnings ✖ | 2 notes ✖\nIf you’re submitting your app-package to CRAN (or want to use check() for other reasons), follow the suggested workflow for check():\n\nThe workflow for checking a package is simple, but tedious:\n\nRun devtools::check() or press Shift + Ctrl/Cmd + E\nFix the first problem.\nRepeat until there are no more problems.’\n\n\nI’ve found a good habit for when to check() to be:\nAfter adding a bug fix or feature, check a package and keep any notes, warnings, or errors from accumulating.\n\n\n\n\n\nRecap\nCreating an app-package involves adopting some new devtools habits, and the initial contents of moviesApp hopefully helped demonstrate the purpose of each function.\n\n\n\n\n\n\nRecap: Package development habits\n\n\n\n\n\n\nAfter installing and loading devtools:\n\nLoad the package whenever changes occur in the R/ folder.\n\nCtrl/Cmd + Shift + L load all the code in the package.\n\nDocument the package whenever changes are made to any roxygen2 syntax (or settings).\n\nCtrl/Cmd + Shift + D record the documentation and dependencies.\n\nInstall the package after the initial setup, after major changes to the code, documentation, or dependencies, and before committing or sharing.\n\nCtrl/Cmd + Shift + B confirms the package can be installed.\n\n\nHabits require repetition to develop, and I hope the workflow above can be applied to your shiny app-packages, provided you’re using devtools and Posit workbench.\n\n\n\n\nThe following section will cover documenting functions with roxygen2" }, { "objectID": "development.html#footnotes", @@ -347,14 +347,14 @@ "href": "app_packages.html#review-chapters-1---4", "title": "App-packages", "section": "Review Chapters 1 - 4", - "text": "Review Chapters 1 - 4\nLet’s briefly review what we’ve covered in the last three chapters:\n\nWhole app game (Chapter 1)\nChapter 1 walks through the ‘whole game’ of the app-package development workflow. The application in this example comes from the Packages chapter of Mastering Shiny.\n\n\n\n\n\n\nChapter 1: GitHub Repository & Branches\n\n\n\n\n\n\nThe code for Chapter 1 (Whole app game) is stored in the following repository:\n\nmonthAppPkg\n\n\n\n\n\n\n\nShiny (Chapter 2)\nThe Shiny Chapter covered shiny projects and some ‘pre-package practices’ to adopt for your shiny app that can make the transition to working with app-packages easier.\n\n\n\n\n\n\nChapter 2: GitHub Repository & Branches\n\n\n\n\n\n\nThe code for Chapter 2 (Shiny) is stored in the following branches:\n\nmain: Contains a new shiny app project created from the New Project Wizard (with Old Faithful Geyser Data)\n02_movies-app: The boilerplate app in app.R is replaced with the code for the movie review application, and the scatter_plot() utility function is added to utils.R and movies.RData is added to the project.\n03_proj-app contains an ‘fully developed’ shiny app project with the following contents:\n\nDESCRIPTION file\n\nREADME.md file\n\nR/ folder\n\nModules: two module files are created in the R/ folder (mod_var_input.R and mod_scatter_display.R)\n\nStandalone app function: the code in app.R is converted to a standalone app function: movies_app()\nUtility function: Move utils.R into the R/ folder\n\n\nThe www/ folder contains the image file (shiny.png)\n\nDeployment: The rsconnect/ folder contains files for deploying to shinyapps.io\n\n\n\n\n\n\n\n\nPackages (Chapter 3)\nPackages illustrated what separates projects from R packages. This chapter also covered 1) how to create a new shiny app-package or 2) convert an existing shiny project into an app-package.\n\n\n\n\n\n\nChapter 3: GitHub Repository & Branches\n\n\n\n\n\n\nThe code for Chapter 3 (Packages) is stored in the following branches:\n\n03_proj-app is an ‘advanced’ package from the previous chapter\n04_description is a branch from 03_proj-app and adds the seven mandatory DESCRIPTION fields.\n05_rproj is a branch from 04_description and manually converts the shiny app project to a shiny app-package using the .Rproj file.\n06_create-package is a branch from 03_proj-app and creates a package using usethis::create_package()\n\n\n\n\n\n\n\nDevelopment (Chapter 4)\nChapter 4 introduced the devtools package and its core functions (load_all(), document(), and install()).\n\n\n\n\n\n\nChapter 4: GitHub Repository & Branches\n\n\n\n\n\n\nThe code for Chapter 4 (Development) is stored in the following branch:\n\n06_devtools is a branch from the manually converted app-package in 05_rproj\n\n\n\n\n\nWe’re now at a point that we’ve converted a Shiny project (moviesApp) into a package. The package conversions live in the 06_devtools and 06_create-package branches:\n\nIn the 06_devtools branch, moviesApp was converted to a package by manually adding the required fields to the DESCRIPTION file, then running the key devtools development functions (load_all(), document(), and install())\n\nPackage: moviesApp\nTitle: movies app\nVersion: 0.0.0.9000\nAuthor: John Smith [aut, cre]\nMaintainer: John Smith <John.Smith@email.io>\nDescription: A movie-review shiny application.\nLicense: GPL-3\nRoxygenNote: 7.2.3\nEncoding: UTF-8\n1\n\n\n1\n\nAlways leave an empty line in the DESCRIPTION\n\n\n\n\nIn the 06_create-package branch, we used the usethis::create_package() function to convert moviesApp into a package.\n\nPackage: moviesApp\nTitle: movies app\nVersion: 0.0.0.9000\nAuthor: John Smith [aut, cre]\nMaintainer: John Smith <John.Smith@email.io>\nDescription: A movie-review shiny application.\nLicense: GPL-3\nEncoding: UTF-8\nRoxygen: list(markdown = TRUE)\nRoxygenNote: 7.2.3\n\nThe only difference between these two branches lies in the DESCRIPTION files–in the 06_create-package branch, the Roxygen: list(markdown = TRUE) field was added (which we will cover in the upcoming Documentation chapter)." + "text": "Review Chapters 1 - 4\nLet’s briefly review what we’ve covered in the last three chapters:\n\nWhole app game (Chapter 1)\nChapter 1 walks through the ‘whole game’ of the app-package development workflow. The application in this example comes from the Packages chapter of Mastering Shiny.\n\n\n\n\n\n\nChapter 1: GitHub Repository & Branches\n\n\n\n\n\n\nThe code for Chapter 1 (Whole app game) is stored in the following repository:\n\nmonthAppPkg\n\n\n\n\n\n\n\nShiny (Chapter 2)\nThe Shiny Chapter covered shiny projects and some ‘pre-package practices’ to adopt for your shiny app that can make the transition to working with app-packages easier.\n\n\n\n\n\n\nChapter 2: GitHub Repository & Branches\n\n\n\n\n\n\nThe code for Chapter 2 (Shiny) is stored in the following branches:\n\nmain: Contains a new shiny app project created from the New Project Wizard (with Old Faithful Geyser Data)\n02_movies-app: The boilerplate app in app.R is replaced with the code for the movie review application, and the scatter_plot() utility function is added to utils.R and movies.RData is added to the project.\n03_proj-app contains an ‘fully developed’ shiny app project with the following contents:\n\nDESCRIPTION file\n\nREADME.md file\n\nR/ folder\n\nModules: two module files are created in the R/ folder (mod_var_input.R and mod_scatter_display.R)\n\nStandalone app function: the code in app.R is converted to a standalone app function: movies_app()\nUtility function: Move utils.R into the R/ folder\n\n\nThe www/ folder contains the image file (shiny.png)\n\nDeployment: The rsconnect/ folder contains files for deploying to shinyapps.io\n\n\n\n\n\n\n\n\nPackages (Chapter 3)\nPackages illustrated what separates projects from R packages. This chapter also covered 1) how to create a new shiny app-package or 2) convert an existing shiny project into an app-package.\n\n\n\n\n\n\nChapter 3: GitHub Repository & Branches\n\n\n\n\n\n\nThe code for Chapter 3 (Packages) is stored in the following branches:\n\n03_proj-app is an ‘advanced’ package from the previous chapter\n04_description is a branch from 03_proj-app and adds the seven mandatory DESCRIPTION fields.\n05_rproj is a branch from 04_description and manually converts the shiny app project to a shiny app-package using the .Rproj file.\n06a_create-package is a branch from 05_rproj and creates a package using usethis::create_package()\n\n\n\n\n\n\n\nDevelopment (Chapter 4)\nChapter 4 introduced the devtools package and its core functions (load_all(), document(), and install()).\n\n\n\n\n\n\nChapter 4: GitHub Repository & Branches\n\n\n\n\n\n\nThe code for Chapter 4 (Development) is stored in the following branch:\n\n06b_devtools is a branch from the manually converted app-package in 05_rproj\n\n\n\n\n\nWe’re now at a point that we’ve converted a Shiny project (moviesApp) into a package. The package conversions live in the 06_devtools and 06_create-package branches:\n\nIn the 06_devtools branch, moviesApp was converted to a package by manually adding the required fields to the DESCRIPTION file, then running the key devtools development functions (load_all(), document(), and install())\n\nPackage: moviesApp\nTitle: movies app\nVersion: 0.0.0.9000\nAuthor: John Smith [aut, cre]\nMaintainer: John Smith <John.Smith@email.io>\nDescription: A movie-review shiny application.\nLicense: GPL-3\nRoxygenNote: 7.2.3\nEncoding: UTF-8\n1\n\n\n1\n\nAlways leave an empty line in the DESCRIPTION\n\n\n\n\nIn the 06_create-package branch, we used the usethis::create_package() function to convert moviesApp into a package.\n\nPackage: moviesApp\nTitle: movies app\nVersion: 0.0.0.9000\nAuthor: John Smith [aut, cre]\nMaintainer: John Smith <John.Smith@email.io>\nDescription: A movie-review shiny application.\nLicense: GPL-3\nEncoding: UTF-8\nRoxygen: list(markdown = TRUE)\nRoxygenNote: 7.2.3\n\nThe only difference between these two branches lies in the DESCRIPTION files–in the 06_create-package branch, the Roxygen: list(markdown = TRUE) field was added (which we will cover in the upcoming Documentation chapter)." }, { "objectID": "app_packages.html#app-packages", "href": "app_packages.html#app-packages", "title": "App-packages", "section": "App-packages", - "text": "App-packages\nThe following six chapter will continue with app-package development, emphasizing developing a shiny application within a package structure.\nIn the following chapters, we’ll be using code from the moviesApp repository:\n\n\n\n\n\n\nmoviesApp/tree/main\n\n\n\n\n\n\nThe code for the next section can be found in the moviesApp repository.\nThe main branch of moviesApp is identical to the 06_create-package branch from the moviesApp repository from the previous section:\nmoviesApp/ \n ├── DESCRIPTION\n ├── NAMESPACE\n ├── R\n │ ├── mod_scatter_display.R\n │ ├── mod_var_input.R\n │ └── utils.R\n ├── README.md\n ├── app.R\n ├── man\n ├── movies.RData\n ├── moviesApp.Rproj\n └── www\n └── shiny.png\n \n 4 directories, 10 files\nThe rsconnect/ folder has been removed because we’ll cover deploying moviesApp in future sections.\n\n\n\n\nA preview of the topics covered in the following chapters is provided below.\n\nDocumentation (Chapter 5)\nChapter 5 covers documenting your app-package code in the R/ folder:\n\nroxygen2 basics:\n\nRequired tags:\n\n@title, @description, @details, @param, @return, and @examples\n\n\nApp-package tags for modules and standalone app functions:\n\n@seealso, @family, and @section\n\n\n\n\n\nDependencies (Chapter 6)\nChapter 6 dives into dependencies. We’ll cover how to export functions and objects from your app-packages for others to use, and how to handle functions from add-on (i.e., external) packages.\n\nExporting functions from your package namespace\n\n@export/export()\n\n\nImporting functions from add-on packages into your package namespace\n\n@import/import(), @importFrom/importFrom()\n\n\nThe Imports field in the DESCRIPTION\n\nusethis::use_package()\n\n\n\n\nData (Chapter 7)\nData covers how to include datasets in your app-package namespace, and the various kinds of data in R packages.\n\nDocumenting data with\n\nroxygen2: @format, \\describe, \\item\n\n\nLocation of data files: data/ vs. data-raw/ vs. inst/extdata/\n\n\n\nLaunch (Chapter 8)\nThe Launch chapter covers how to 1) run your application during development, how to run your app using a standalone app function, and 3) how to deploy your application to shinyapps.io.\n\nWhat goes in app.R?\n\nshinyApp() vs. shinyAppDir() vs. runApp()\n\nrsconnect::deployApp()\n\n\n\n\nExternal files (Chapter 9)\nThe Chapter 9 covers how to include external resources (i.e. the images, CSS, html, or other files that are typically included in the www/ folder and served when you run your shiny app). This chapter also covers other uses for the isnt/ folder in app-packages.\n\nwww/ vs. inst/\nsystem.file()\naddResourcePath()\n\n\n\nTests (Chapter 10)\nTests introduces the BDD functions and how to ‘scope’ the tests in your app-package before writing any code.\n\nUser specifications, features, functional requirements\nTest fixtures and helpers\nModule server function tests with testServer()\nSystem tests with shinytest2" + "text": "App-packages\nThe following six chapter will continue with app-package development, emphasizing developing a shiny application within a package structure.\nIn the following chapters, we’ll be using code from the moviesApp repository:\n\n\n\n\n\n\nmoviesApp/tree/\n\n\n\n\n\n\nThe code for the next section can be found in the 06b_devtools branch of moviesApp repository.\nmoviesApp/ \n ├── DESCRIPTION\n ├── NAMESPACE\n ├── R\n │ ├── mod_scatter_display.R\n │ ├── mod_var_input.R\n │ └── utils.R\n ├── README.md\n ├── app.R\n ├── man\n ├── movies.RData\n ├── moviesApp.Rproj\n └── www\n └── shiny.png\n \n 4 directories, 10 files\nThe rsconnect/ folder has been removed because we’ll cover deploying moviesApp in future sections.\n\n\n\n\nA preview of the topics covered in the following chapters is provided below.\n\nDocumentation (Chapter 5)\nChapter 5 covers documenting your app-package code in the R/ folder:\n\nroxygen2 basics:\n\nRequired tags:\n\n@title, @description, @details, @param, @return, and @examples\n\n\nApp-package tags for modules and standalone app functions:\n\n@seealso, @family, and @section\n\n\n\n\n\nDependencies (Chapter 6)\nChapter 6 dives into dependencies. We’ll cover how to export functions and objects from your app-packages for others to use, and how to handle functions from add-on (i.e., external) packages.\n\nExporting functions from your package namespace\n\n@export/export()\n\n\nImporting functions from add-on packages into your package namespace\n\n@import/import(), @importFrom/importFrom()\n\n\nThe Imports field in the DESCRIPTION\n\nusethis::use_package()\n\n\n\n\nData (Chapter 7)\nData covers how to include datasets in your app-package namespace, and the various kinds of data in R packages.\n\nDocumenting data with\n\nroxygen2: @format, \\describe, \\item\n\n\nLocation of data files: data/ vs. data-raw/ vs. inst/extdata/\n\n\n\nLaunch (Chapter 8)\nThe Launch chapter covers how to 1) run your application during development, how to run your app using a standalone app function, and 3) how to deploy your application to shinyapps.io.\n\nWhat goes in app.R?\n\nshinyApp() vs. shinyAppDir() vs. runApp()\n\nrsconnect::deployApp()\n\n\n\n\nExternal files (Chapter 9)\nThe Chapter 9 covers how to include external resources (i.e. the images, CSS, html, or other files that are typically included in the www/ folder and served when you run your shiny app). This chapter also covers other uses for the isnt/ folder in app-packages.\n\nwww/ vs. inst/\nsystem.file()\naddResourcePath()" }, { "objectID": "document.html#roxygen2-basics", @@ -655,7 +655,7 @@ "href": "test_suite.html#creating-unit-tests", "title": "Test suite", "section": "Creating unit tests", - "text": "Creating unit tests\nThe standard workflow for writing testthat unit tests consists of the following:\n\nNew tests are created with usethis::use_test():\n\n\nusethis::use_test(\"scatter_plot\") \n\n\ntestthat recommends having a corresponding test file in tests/testthat/ (with the test- prefix) for the files in R/.\n\n\ntest- files\n\nTest files: the IDE will automatically create and open the new test file:\n\n✔ Writing 'tests/testthat/test-scatter_plot.R'\n• Modify 'tests/testthat/test-scatter_plot.R'\n\n\ntest_that() tests\n\nEach new test file contains a boilerplate test_that() test:\n\n\n1test_that(desc = \"multiplication works\", code = {\n \n})\n\n\n1\n\ndesc is the test context (supplied in \"quotes\"), and code is the test code (supplied in {curly brackets}).\n\n\n\n\n\n\nexpect_ations\n\nExpectation typically have two parts: an observed object, and an expected object:\n\n\n1expect_equal(\n2 object = 2 * 2,\n3 expected = 4\n ) \n\n\n1\n\nA testthat expectation function\n\n\n2\n\nThe output or behavior being tested\n\n\n3\n\nA predefined output or behavior\n\n\n\n\n\nThe observed object is an artifact of some code we’ve written, and it’s being compared against an expected result.\n\n\n\nRunning tests\n\nAnother devtools habit to adopt is regularly writing and running tests. If you’re using Posit Workbench and have devtools installed, you can test your app-package using the Build pane or the keyboard shortcut: Ctrl/Cmd + Shift + T\n\n\n\n\n\n\nRun all tests\n\n\n\n\nKeyboard shortcuts\nR Packages, 2ed also suggests binding test_active_file() and test_coverage_active_file() to keyboard shortcuts. I highly recommend using a shortcut while developing tests because it will improve your ability to iterate quickly.\n\n\n\ndevtools function\ntest()\n\n\n \n\n\nKeyboard shortcut\nCtrl/Cmd + Shift + T\n\n\n\n\n\n\ntest_active_file()\n\n\n \n\n\nCtrl/Cmd + T\n\n\n\n\n\n\ntest_coverage_active_file()\n\n\n \n\n\nCtrl/Cmd + Shift + R\n\n\n\nWhen the test is run, we’ll see feedback on whether it passes or fails (and occasionally some encouragement):\n\ntest_that(\"multiplication works\", { \n expect_equal( \n object = 2 * 2, \n expected = 4 \n ) \n})\n## Test passed 😀" + "text": "Creating unit tests\nThe standard workflow for writing testthat unit tests consists of the following:\n\nNew tests are created with usethis::use_test():\n\n\nusethis::use_test(\"scatter_plot\") \n\n\ntestthat recommends having a corresponding test file in tests/testthat/ (with the test- prefix) for the files in R/.\n\n\ntest- files\n\nTest files: the IDE will automatically create and open the new test file:\n\n✔ Writing 'tests/testthat/test-scatter_plot.R'\n• Modify 'tests/testthat/test-scatter_plot.R'\n\n\ntest_that() tests\n\nEach new test file contains a boilerplate test_that() test:\n\n\n1test_that(desc = \"multiplication works\", code = {\n \n})\n\n\n1\n\ndesc is the test context (supplied in \"quotes\"), and code is the test code (supplied in {curly brackets}).\n\n\n\n\n\n\nexpect_ations\n\nExpectation typically have two parts: an observed object, and an expected object:\n\n\n1expect_equal(\n2 object = 2 * 2,\n3 expected = 4\n ) \n\n\n1\n\nA testthat expectation function\n\n\n2\n\nThe output or behavior being tested\n\n\n3\n\nA predefined output or behavior\n\n\n\n\n\nThe observed object is an artifact of some code we’ve written, and it’s being compared against an expected result.\n\n\n\nRunning tests\n\nAnother devtools habit to adopt is regularly writing and running tests. If you’re using Posit Workbench and have devtools installed, you can test your app-package using the Build pane or the keyboard shortcut: Ctrl/Cmd + Shift + T\n\n\n\n\n\n\nRun all tests\n\n\n\n\nKeyboard shortcuts\nR Packages, 2ed also suggests binding test_active_file() and test_coverage_active_file() to keyboard shortcuts. I highly recommend using a shortcut while developing tests because it will improve your ability to iterate quickly.\n\n\n\ndevtools function\ntest()\n\n\n \n\n\nKeyboard shortcut\nCtrl/Cmd + Shift + T\n\n\n\n\n\n\ntest_active_file()\n\n\n \n\n\nCtrl/Cmd + T\n\n\n\n\n\n\ntest_coverage_active_file()\n\n\n \n\n\nCtrl/Cmd + Shift + R\n\n\n\nWhen the test is run, we’ll see feedback on whether it passes or fails (and occasionally some encouragement):\n\ntest_that(\"multiplication works\", { \n expect_equal( \n object = 2 * 2, \n expected = 4 \n ) \n})\n## Test passed 🥳" }, { "objectID": "test_suite.html#recap", diff --git a/shiny.html b/shiny.html index 7c72e03..ba3e2fa 100644 --- a/shiny.html +++ b/shiny.html @@ -821,7 +821,7 @@

    Update
    1
    -Comment out these lines after installing pkgs +Comment out these lines after installing pkgs
    @@ -1053,30 +1053,30 @@

    1
    -y axis numeric variable +y axis numeric variable
    2
    -x axis numeric variable +x axis numeric variable
    3
    -z axis categorical variable
    +z axis categorical variable
    4
    -alpha numeric value for points
    +alpha numeric value for points
    5
    -size numeric value for size
    +size numeric value for size
    6
    -plot_title text +plot_title text
    @@ -1107,30 +1107,30 @@
    1
    -y axis numeric variable +y axis numeric variable
    2
    -x axis numeric variable +x axis numeric variable
    3
    -z axis categorical variable
    +z axis categorical variable
    4
    -alpha numeric value for points
    +alpha numeric value for points
    5
    -size numeric value for size
    +size numeric value for size
    6
    -plot_title text +plot_title text
    @@ -1164,7 +1164,7 @@
    1
    -Namespaced module id for plot in UI +Namespaced module id for plot in UI
    @@ -1221,23 +1221,23 @@
    1
    -loading the movies data +loading the movies data
    2
    -assembling the returned values from mod_var_input_server(), and creating the input() reactive +assembling the returned values from mod_var_input_server(), and creating the input() reactive
    3
    -scatter_plot() utility function creates the plot object +scatter_plot() utility function creates the plot object
    4
    -adds the plot_title() +adds the plot_title()
    5
    -add theme to layers +add theme to layers
    @@ -1310,28 +1310,28 @@
    app.R
    1
    -Header (comment this out after the packages are installed) +Header (comment this out after the packages are installed)
    2
    -Load packages
    +Load packages
    3
    -Variable input UI module +Variable input UI module
    4
    -Graph display UI module +Graph display UI module
    5
    -Variable input server module +Variable input server module
    6
    -Graph display server module +Graph display server module
    diff --git a/sitemap.xml b/sitemap.xml index 10bde27..3a61292 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -2,138 +2,138 @@ https://mjfrigaard.github.io/shinyap/index.html - 2023-10-28T20:06:08.631Z + 2023-10-28T20:36:19.030Z https://mjfrigaard.github.io/shinyap/intro.html - 2023-10-28T20:06:08.647Z + 2023-10-28T20:36:19.050Z https://mjfrigaard.github.io/shinyap/whole_game.html - 2023-10-28T20:06:08.689Z + 2023-10-28T20:36:19.089Z https://mjfrigaard.github.io/shinyap/shiny.html - 2023-10-28T20:06:08.797Z + 2023-10-28T20:36:19.175Z https://mjfrigaard.github.io/shinyap/packages.html - 2023-10-28T20:06:08.859Z + 2023-10-28T20:36:19.229Z https://mjfrigaard.github.io/shinyap/development.html - 2023-10-28T20:06:08.898Z + 2023-10-28T20:36:19.266Z https://mjfrigaard.github.io/shinyap/app_packages.html - 2023-10-28T20:06:08.917Z + 2023-10-28T20:36:19.285Z https://mjfrigaard.github.io/shinyap/document.html - 2023-10-28T20:06:08.976Z + 2023-10-28T20:36:19.345Z https://mjfrigaard.github.io/shinyap/dependencies.html - 2023-10-28T20:06:09.042Z + 2023-10-28T20:36:19.437Z https://mjfrigaard.github.io/shinyap/data.html - 2023-10-28T20:06:09.089Z + 2023-10-28T20:36:19.486Z https://mjfrigaard.github.io/shinyap/launch.html - 2023-10-28T20:06:09.145Z + 2023-10-28T20:36:19.545Z https://mjfrigaard.github.io/shinyap/external.html - 2023-10-28T20:06:09.236Z + 2023-10-28T20:36:19.639Z https://mjfrigaard.github.io/shinyap/tests.html - 2023-10-28T20:06:09.245Z + 2023-10-28T20:36:19.647Z https://mjfrigaard.github.io/shinyap/test_suite.html - 2023-10-28T20:06:09.267Z + 2023-10-28T20:36:19.668Z https://mjfrigaard.github.io/shinyap/test_specs.html - 2023-10-28T20:06:09.294Z + 2023-10-28T20:36:19.699Z https://mjfrigaard.github.io/shinyap/test_tools.html - 2023-10-28T20:06:09.347Z + 2023-10-28T20:36:19.755Z https://mjfrigaard.github.io/shinyap/test_modules.html - 2023-10-28T20:06:09.378Z + 2023-10-28T20:36:19.783Z https://mjfrigaard.github.io/shinyap/test_system.html - 2023-10-28T20:06:09.415Z + 2023-10-28T20:36:19.826Z https://mjfrigaard.github.io/shinyap/frameworks.html - 2023-10-28T20:06:09.423Z + 2023-10-28T20:36:19.834Z https://mjfrigaard.github.io/shinyap/golem.html - 2023-10-28T20:06:09.438Z + 2023-10-28T20:36:19.843Z https://mjfrigaard.github.io/shinyap/leprechaun.html - 2023-10-28T20:06:09.447Z + 2023-10-28T20:36:19.852Z https://mjfrigaard.github.io/shinyap/rhino.html - 2023-10-28T20:06:09.456Z + 2023-10-28T20:36:19.861Z https://mjfrigaard.github.io/shinyap/special_topics.html - 2023-10-28T20:06:09.464Z + 2023-10-28T20:36:19.873Z https://mjfrigaard.github.io/shinyap/debugging.html - 2023-10-28T20:06:09.567Z + 2023-10-28T20:36:19.934Z https://mjfrigaard.github.io/shinyap/code_tools.html - 2023-10-28T20:06:09.577Z + 2023-10-28T20:36:19.943Z https://mjfrigaard.github.io/shinyap/test_mocks.html - 2023-10-28T20:06:09.597Z + 2023-10-28T20:36:19.962Z https://mjfrigaard.github.io/shinyap/css.html - 2023-10-28T20:06:09.605Z + 2023-10-28T20:36:19.970Z https://mjfrigaard.github.io/shinyap/js.html - 2023-10-28T20:06:09.614Z + 2023-10-28T20:36:19.989Z https://mjfrigaard.github.io/shinyap/cicd.html - 2023-10-28T20:06:09.624Z + 2023-10-28T20:36:20.009Z https://mjfrigaard.github.io/shinyap/github.html - 2023-10-28T20:06:09.640Z + 2023-10-28T20:36:20.040Z https://mjfrigaard.github.io/shinyap/create.html - 2023-10-28T20:06:09.653Z + 2023-10-28T20:36:20.052Z https://mjfrigaard.github.io/shinyap/comparisons.html - 2023-10-28T20:06:09.672Z + 2023-10-28T20:36:20.069Z https://mjfrigaard.github.io/shinyap/bdd.html - 2023-10-28T20:06:09.690Z + 2023-10-28T20:36:20.080Z https://mjfrigaard.github.io/shinyap/glossary.html - 2023-10-28T20:06:09.699Z + 2023-10-28T20:36:20.089Z diff --git a/test_mocks.html b/test_mocks.html index 3ff5d67..6e270fa 100644 --- a/test_mocks.html +++ b/test_mocks.html @@ -498,16 +498,16 @@

    Example:
    1
    -Log test start and end +Log test start and end
    2
    -Set {value} to FALSE
    +Set {value} to FALSE
    3
    -Pass a package we know is not installed +Pass a package we know is not installed
    @@ -533,16 +533,16 @@

    Example:
    1
    -Log test start and end +Log test start and end
    2
    -Set {value} to TRUE
    +Set {value} to TRUE
    3
    -Pass a package we know is installed +Pass a package we know is installed
    @@ -581,7 +581,7 @@

    Notes on mocking

    1
    -Fortunately we already included rlang in our DESCRIPTION file for .data in scatter_plot() +Fortunately we already included rlang in our DESCRIPTION file for .data in scatter_plot()
    diff --git a/test_modules.html b/test_modules.html index 2d734c3..151fb5d 100644 --- a/test_modules.html +++ b/test_modules.html @@ -473,22 +473,22 @@

    1
    -Call to testServer()
    +Call to testServer()
    2
    -Create output values for comparison
    +Create output values for comparison
    3
    -Set each input using setInputs(input = )
    +Set each input using setInputs(input = )
    4
    -Confirm returned values against test_vals +Confirm returned values against test_vals
    @@ -512,7 +512,7 @@

    1
    -Calls return(reactive(list(...))) +Calls return(reactive(list(...)))
    @@ -594,12 +594,12 @@

    1
    -List of reactive variable inputs
    +List of reactive variable inputs
    2
    -Compare inputs() to initial values +Compare inputs() to initial values
    @@ -671,12 +671,12 @@

    Testing
    1
    -Build graph (same code from module function)
    +Build graph (same code from module function)
    2
    -Confirm ggplot2 object is built +Confirm ggplot2 object is built
    diff --git a/test_specs.html b/test_specs.html index f50a986..cd68885 100644 --- a/test_specs.html +++ b/test_specs.html @@ -645,12 +645,12 @@

    1
    -BDD Feature (title and description)
    +BDD Feature (title and description)
    2
    -Background (preexisting conditions before each scenario) +Background (preexisting conditions before each scenario)
    @@ -690,20 +690,20 @@

    Confirm
    1
    -BDD Feature (title and description)
    +BDD Feature (title and description)
    2
    -Background (preexisting conditions before each scenario) +Background (preexisting conditions before each scenario)
    3
    -Scenario (a concrete examples that illustrates a feature) +Scenario (a concrete examples that illustrates a feature)
    4
    -Test code +Test code
    diff --git a/test_suite.html b/test_suite.html index 1bac64d..4051de8 100644 --- a/test_suite.html +++ b/test_suite.html @@ -482,7 +482,7 @@

    1
    -Referred to as the ‘test runner,’ because it runs all our tests (do not edit this file). +Referred to as the ‘test runner,’ because it runs all our tests (do not edit this file).
    @@ -521,7 +521,7 @@

    1
    -desc is the test context (supplied in "quotes"), and code is the test code (supplied in {curly brackets}). +desc is the test context (supplied in "quotes"), and code is the test code (supplied in {curly brackets}).
    @@ -541,17 +541,17 @@

    1
    -A testthat expectation function
    +A testthat expectation function
    2
    -The output or behavior being tested
    +The output or behavior being tested
    3
    -A predefined output or behavior +A predefined output or behavior
    @@ -626,7 +626,7 @@

    Keyboard shortcut

    expected = 4 ) }) -## Test passed 😀 +## Test passed 🥳
    diff --git a/test_tools.html b/test_tools.html index 8bfe02f..c63c761 100644 --- a/test_tools.html +++ b/test_tools.html @@ -487,11 +487,11 @@

    Test data

    1
    -The code used to create the test data (make-make_tidy_ggp2_movies.R) +The code used to create the test data (make-make_tidy_ggp2_movies.R)
    2
    -The test data file (i.e., tidy_ggp2_movies.rds): +The test data file (i.e., tidy_ggp2_movies.rds):
    @@ -528,37 +528,37 @@

    Example: test fixture
    1
    -High-level description (title and description)
    +High-level description (title and description)
    2
    -Steps or conditions that exist before each scenario
    +Steps or conditions that exist before each scenario
    3
    -Used to describe the initial context or preconditions for the scenario
    +Used to describe the initial context or preconditions for the scenario
    4
    -A series of steps outlining a concrete examples that illustrates a feature
    +A series of steps outlining a concrete examples that illustrates a feature
    5
    -Used to describe an event, or an action
    +Used to describe an event, or an action
    6
    -Use to combine Given, When, or Then
    +Use to combine Given, When, or Then
    7
    -Use to verify expected outcomes that are observable by a user +Use to verify expected outcomes that are observable by a user
    @@ -618,32 +618,32 @@

    Example: test fixture
    1
    -Feature
    +Feature
    2
    -Scenario
    +Scenario
    3
    -Test inputs
    +Test inputs
    4
    -Test fixture
    +Test fixture
    5
    -Create observed object
    +Create observed object
    6
    -Expectation +Expectation
    @@ -671,17 +671,17 @@

    Helpers

    1
    -Test fixture scripts and .rds files
    +Test fixture scripts and .rds files
    2
    -Helper functions
    +Helper functions
    3
    -Test file +Test file
    @@ -750,12 +750,12 @@

    Helpers

    1
    -Load test fixture
    +Load test fixture
    2
    -Identical to the code in mod_scatter_display_server() +Identical to the code in mod_scatter_display_server()
    @@ -991,27 +991,27 @@

    Example: snapshots

    1
    -Test scope (T2)
    +Test scope (T2)
    2
    -Log start (T2)
    +Log start (T2)
    3
    -Initial movies variable inputs for x, y, and z from UI
    +Initial movies variable inputs for x, y, and z from UI
    4
    -Snapshot with initial values
    +Snapshot with initial values
    5
    -Log end (T2)
    +Log end (T2)
    diff --git a/whole_game.html b/whole_game.html index cf7bb28..4e04e56 100644 --- a/whole_game.html +++ b/whole_game.html @@ -492,7 +492,7 @@

    1
    -Always leave an empty final line in the DESCRIPTION +Always leave an empty final line in the DESCRIPTION