From 061d905b43243ffd4f95ad8019d7d43510ecf2de Mon Sep 17 00:00:00 2001 From: Tom Smith Date: Wed, 8 Nov 2023 20:12:00 +0000 Subject: [PATCH 1/6] move example reports --- {inst => pkgdown/assets}/report_examples/My_Example Report.html | 0 .../assets}/report_examples/My_Example Report_data.csv | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename {inst => pkgdown/assets}/report_examples/My_Example Report.html (100%) rename {inst => pkgdown/assets}/report_examples/My_Example Report_data.csv (100%) diff --git a/inst/report_examples/My_Example Report.html b/pkgdown/assets/report_examples/My_Example Report.html similarity index 100% rename from inst/report_examples/My_Example Report.html rename to pkgdown/assets/report_examples/My_Example Report.html diff --git a/inst/report_examples/My_Example Report_data.csv b/pkgdown/assets/report_examples/My_Example Report_data.csv similarity index 100% rename from inst/report_examples/My_Example Report_data.csv rename to pkgdown/assets/report_examples/My_Example Report_data.csv From ee02f253c784f47b0d84bcb43dd62ef855e9f75b Mon Sep 17 00:00:00 2001 From: Tom Smith Date: Wed, 8 Nov 2023 21:31:17 +0000 Subject: [PATCH 2/6] add report link to pkgdown navbar --- _pkgdown.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/_pkgdown.yml b/_pkgdown.yml index d259b1c..a9cbd47 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -2,3 +2,11 @@ url: https://thomuk.github.io/SPCreporter/ template: bootstrap: 5 +navbar: + structure: + left: [intro, report_examples, reference, articles, tutorials, news] + right: [search, github] + components: + report_examples: + text: Example Report + href: report_examples/My_Example Report.html From ef510d142e2d41a09b9f2fd8f26b378cca50d373 Mon Sep 17 00:00:00 2001 From: Tom Smith Date: Wed, 8 Nov 2023 21:32:00 +0000 Subject: [PATCH 3/6] add report link to readme --- README.Rmd | 4 ++-- README.md | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/README.Rmd b/README.Rmd index 83968c7..639e336 100644 --- a/README.Rmd +++ b/README.Rmd @@ -17,7 +17,7 @@ knitr::opts_chunk$set( # {SPCreporter} -{SPCreporter} is a simple way to add value to your performance reporting using statistical process control. +{SPCreporter} is a simple way to add value to your performance reporting using statistical process control. It produces reports similar to this [**example report**](report_examples/My_Example Report.html). **Help sort signals from noise, and ensure your leadership are talking about signals that matter.** @@ -65,7 +65,7 @@ spcr_make_report( ### See the vignettes for additional examples: -[Get Started vignette](https://thomuk.github.io/SPCreporter/articles/get_started.html) - Start here to produce your first reprot using data that is bundled into this package. +[Get Started vignette](https://thomuk.github.io/SPCreporter/articles/get_started.html) - Start here to produce your first report using data that is bundled into this package. [Creating multiple reports](https://thomuk.github.io/SPCreporter/articles/multiple_reports.html) - An example of how to use {purrr} to automate groups of reports. diff --git a/README.md b/README.md index 085465b..8a9d09d 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,8 @@ # {SPCreporter} {SPCreporter} is a simple way to add value to your performance reporting -using statistical process control. +using statistical process control. It produces reports similar to this +[**example report**](report_examples/My_Example%20Report.html). **Help sort signals from noise, and ensure your leadership are talking about signals that matter.** @@ -60,7 +61,7 @@ spcr_make_report( [Get Started vignette](https://thomuk.github.io/SPCreporter/articles/get_started.html) - -Start here to produce your first reprot using data that is bundled into +Start here to produce your first report using data that is bundled into this package. [Creating multiple From 9437d188cb894870870265a8081892730c45e510 Mon Sep 17 00:00:00 2001 From: Tom Smith Date: Wed, 8 Nov 2023 21:32:26 +0000 Subject: [PATCH 4/6] fix vignette naming warning on pkgdown build --- vignettes/multiple_reports.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vignettes/multiple_reports.Rmd b/vignettes/multiple_reports.Rmd index cc7223c..b68b71b 100644 --- a/vignettes/multiple_reports.Rmd +++ b/vignettes/multiple_reports.Rmd @@ -2,7 +2,7 @@ title: "Creating multiple reports" output: rmarkdown::html_vignette vignette: > - %\VignetteIndexEntry{Example - creating multiple reports} + %\VignetteIndexEntry{Creating multiple reports} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- From 49caf0fb1820a2e4249f24d67bf317302b630d6e Mon Sep 17 00:00:00 2001 From: Tom Smith Date: Wed, 8 Nov 2023 21:33:03 +0000 Subject: [PATCH 5/6] improve get started vignette and add example report link --- vignettes/get_started.Rmd | 47 ++++++++++++++++++++++++--------------- 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/vignettes/get_started.Rmd b/vignettes/get_started.Rmd index e752109..2f9428f 100644 --- a/vignettes/get_started.Rmd +++ b/vignettes/get_started.Rmd @@ -17,33 +17,40 @@ library(SPCreporter) This vignette covers how to get started with {SPCreporter}. We are going to produce an example report using example files that are bundled into this package. Everything is self-contained. You'll have your first report in no time! -The example uses three _xlsx_ files which are located in the "example_data" folder of the package. +## Preliminary step + +The example uses three _xlsx_ files which are located in the "example_data" folder of the package. This preliminary step is not necessary when working with your own data, but to access the files bundled with the package, we need to run this line. ```{r} #| eval: false # set up to read the package files. You will not need to do this to read your own data. -example_files <- system.file("example_data", package="SPCreporter") +path_to_example_files <- system.file("example_data", package="SPCreporter") +``` + +## 1. Read the data in -#### -# 1. READ THE DATA FILES IN -############################# +```{r} +#| eval: false # read in measure data from the two worksheets in the example file measure_data <- list( - week = readxl::read_xlsx(file.path(example_files, "data.xlsx"), sheet = "week"), - month = readxl::read_xlsx(file.path(example_files, "data.xlsx"), sheet = "month") + week = readxl::read_xlsx(file.path(path_to_example_files, "data.xlsx"), sheet = "week"), + month = readxl::read_xlsx(file.path(path_to_example_files, "data.xlsx"), sheet = "month") ) # read in the report config from example file -report_config <- readxl::read_xlsx(file.path(example_files, "report_config.xlsx")) +report_config <- readxl::read_xlsx(file.path(path_to_example_files, "report_config.xlsx")) # read in measure config from example file -measure_config <- readxl::read_xlsx(file.path(example_files, "measure_config.xlsx")) +measure_config <- readxl::read_xlsx(file.path(path_to_example_files, "measure_config.xlsx")) -#### -# 2. CREATE THE DATA BUNDLE -############################# +``` + +## 2. Create the data bundle + +```{r} +#| eval: false # create the data bundle data_bundle <- spcr_make_data_bundle( @@ -52,9 +59,12 @@ data_bundle <- spcr_make_data_bundle( measure_config = measure_config ) -#### -# 3. MAKE THE REPORT -############################# +``` + +## 3. Make the report + +```{r} +#| eval: false # make the report, including information for the six mandatory arguments. spcr_make_report( @@ -66,9 +76,10 @@ spcr_make_report( author_email = "a.author@example.com" ) - ``` -You should now have an example report in your working directory +Success! Your rendered report should look like this [**example report**](/docs/report_examples/My_Example Report.html). + +Once you have run this example, you might choose to move the three example config files to you own machine, and replicate the process again. -After running this example, the next stage is to move the example files to your machine, and start to modify them to create a report of your own data. +After that, start modifying the files to reflect your own data and reporting needs... From 4953abf862118bbfbf64cd223a1223a798562209 Mon Sep 17 00:00:00 2001 From: Tom Smith Date: Wed, 8 Nov 2023 21:33:13 +0000 Subject: [PATCH 6/6] render docs --- man/SPCreporter-package.Rd | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/man/SPCreporter-package.Rd b/man/SPCreporter-package.Rd index 189e4b9..0b43c4c 100644 --- a/man/SPCreporter-package.Rd +++ b/man/SPCreporter-package.Rd @@ -12,6 +12,7 @@ Takes a dataset file and a configuration file to produce an HTML report with eac Useful links: \itemize{ \item \url{https://github.com/ThomUK/SPCreporter} + \item \url{https://thomuk.github.io/SPCreporter/} \item Report bugs at \url{https://github.com/ThomUK/SPCreporter/issues} } @@ -19,9 +20,9 @@ Useful links: \author{ \strong{Maintainer}: Tom Smith \email{tomsmith_uk@hotmail.com} -Other contributors: +Authors: \itemize{ - \item Fran Barton \email{fbarton@alwaysdata.net} [contributor] + \item Fran Barton \email{fbarton@alwaysdata.net} } }