From 57ecdc0627ce1a589e1077991d052a258061b733 Mon Sep 17 00:00:00 2001 From: alicebyers5 Date: Wed, 24 May 2023 17:10:20 +0100 Subject: [PATCH 1/6] Add instruction for installing on SG network --- README.Rmd | 6 ++++-- README.md | 16 +++++++++++----- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/README.Rmd b/README.Rmd index fe4a77d..abcb627 100644 --- a/README.Rmd +++ b/README.Rmd @@ -41,7 +41,9 @@ More information about the package and its functions can be found on the [sgplot ## Installation -To install sgplot, the remotes package is required. The package can then be installed directly from GitHub with: +If you are working within the Scottish Government network, you can install sgplot in the same way as with other R packages. The easiest way to do this is by using the [pkginstaller](https://github.com/DataScienceScotland/pkginstaller/tree/main) add-in. Further guidance is available on [eRDM](https://erdm.scotland.gov.uk:8443/documents/A42404229/details). + +Alternatively, sgplot can be installed directly from GitHub. Note that this method requires the remotes package and may not work from within the Scottish Government network. ``` r remotes::install_github( @@ -51,7 +53,7 @@ remotes::install_github( ) ``` -Network security settings may prevent `remotes::install_github()` from working. If this is the case, sgplot can be installed by downloading the [zip of the repository](https://github.com/DataScienceScotland/sgplot/archive/main.zip) and running the following code, replacing the section marked `<>` (including the arrows themselves) with the location of the downloaded zip: +Finally, sgplot can also be installed by downloading the [zip of the repository](https://github.com/DataScienceScotland/sgplot/archive/main.zip) and running the following code, replacing the section marked `<>` (including the arrows themselves) with the location of the downloaded zip: ``` r remotes::install_local( diff --git a/README.md b/README.md index 3b1f66f..29b7c6a 100644 --- a/README.md +++ b/README.md @@ -32,8 +32,16 @@ contains lots of examples. ## Installation -To install sgplot, the remotes package is required. The package can then -be installed directly from GitHub with: +If you are working within the Scottish Government network, you can +install sgplot in the same way as with other R packages. The easiest way +to do this is by using the +[pkginstaller](https://github.com/DataScienceScotland/pkginstaller/tree/main) +add-in. Further guidance is available on +[eRDM](https://erdm.scotland.gov.uk:8443/documents/A42404229/details). + +Alternatively, sgplot can be installed directly from GitHub. Note that +this method requires the remotes package and may not work from within +the Scottish Government network. ``` r remotes::install_github( @@ -43,9 +51,7 @@ remotes::install_github( ) ``` -Network security settings may prevent `remotes::install_github()` from -working. If this is the case, sgplot can be installed by downloading the -[zip of the +Finally, sgplot can also be installed by downloading the [zip of the repository](https://github.com/DataScienceScotland/sgplot/archive/main.zip) and running the following code, replacing the section marked `<>` (including the arrows themselves) with the location of the downloaded From b21f418ce28f3f46b9c6c9080bfd7cc0655914f7 Mon Sep 17 00:00:00 2001 From: alicebyers5 Date: Wed, 24 May 2023 17:18:04 +0100 Subject: [PATCH 2/6] Add notes on help files and ggplot2 --- .github/SUPPORT.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/SUPPORT.md b/.github/SUPPORT.md index 87bb34a..25ec113 100644 --- a/.github/SUPPORT.md +++ b/.github/SUPPORT.md @@ -2,6 +2,17 @@ Thanks for using sgplot! +## Try these first + +* If you want to find out more about any of sgplot's functions; help files can be found on the [References](https://datasciencescotland.github.io/sgplot/reference) page of the package website. Alternatively, type `?function_name` into the RStudio console. For example: + + ``` r + ?theme_sg() + ``` + +* If you need help with `ggplot2`, it might be helpful to look at the [sgplot cookbook](https://datasciencescotland.github.io/sgplot/articles/cookbook.html) which contains lots of example code to create various types of chart. The [ggplot2 website](https://ggplot2.tidyverse.org/index.html) may also be helpful. + + ## Where to ask for help * If it's a question: Ask the Scottish Government [R Yammer community](https://web.yammer.com/main/groups/eyJfdHlwZSI6Ikdyb3VwIiwiaWQiOiI2MzQ4MzE2NjczIn0). From 4ab8d30b0fd7978307737616861a789f25efb458 Mon Sep 17 00:00:00 2001 From: alicebyers5 Date: Tue, 30 May 2023 15:08:04 +0100 Subject: [PATCH 3/6] Remove trailing ws --- vignettes/cookbook/_annotations.Rmd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vignettes/cookbook/_annotations.Rmd b/vignettes/cookbook/_annotations.Rmd index 0c4f0a2..c87354f 100644 --- a/vignettes/cookbook/_annotations.Rmd +++ b/vignettes/cookbook/_annotations.Rmd @@ -87,7 +87,7 @@ Annotations may also be used to add value labels to a bar chart. Note that `geom ggplot(bar_data, aes(x = reorder(country, -lifeExp), y = lifeExp)) + geom_col(fill = sg_colour_values["dark-blue"]) + - geom_text(aes(label = round(lifeExp, 1)), + geom_text(aes(label = round(lifeExp, 1)), nudge_y = -5, colour = "white") + theme_sg() + scale_y_continuous(expand = c(0, 0)) + From 1de8e8a93ceed0b5fc061890f39c3c6d9d7ed80b Mon Sep 17 00:00:00 2001 From: alicebyers5 Date: Tue, 30 May 2023 15:08:17 +0100 Subject: [PATCH 4/6] Add action to render readme --- .github/workflows/render-readme.yaml | 35 ++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/render-readme.yaml diff --git a/.github/workflows/render-readme.yaml b/.github/workflows/render-readme.yaml new file mode 100644 index 0000000..b203a08 --- /dev/null +++ b/.github/workflows/render-readme.yaml @@ -0,0 +1,35 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: push + +name: render-readme + +jobs: + render-readme: + runs-on: ubuntu-latest + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + steps: + - name: Checkout repo + uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::rmarkdown, local::. + + - name: Render README + run: Rscript -e 'rmarkdown::render("README.Rmd")' + + - name: Commit rendered README + run: | + git config --local user.name "$GITHUB_ACTOR" + git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com" + git add README.md man/figures/README-* + git commit -m "Re-build README.md" || echo "No changes to commit" + git push origin || echo "No changes to commit" From 9dadf9c8f5a268804c7643bbbe32f8c8953d25e5 Mon Sep 17 00:00:00 2001 From: alicebyers5 Date: Tue, 30 May 2023 14:29:20 +0000 Subject: [PATCH 5/6] Re-build README.md --- man/figures/README-ex1-1.svg | 546 +++++++++++++++++------------------ man/figures/README-ex2-1.svg | 524 ++++++++++++++++----------------- 2 files changed, 535 insertions(+), 535 deletions(-) diff --git a/man/figures/README-ex1-1.svg b/man/figures/README-ex1-1.svg index cd2b694..c0d844f 100644 --- a/man/figures/README-ex1-1.svg +++ b/man/figures/README-ex1-1.svg @@ -3,532 +3,532 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + diff --git a/man/figures/README-ex2-1.svg b/man/figures/README-ex2-1.svg index 0167a54..d3708e3 100644 --- a/man/figures/README-ex2-1.svg +++ b/man/figures/README-ex2-1.svg @@ -3,500 +3,500 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - - - - - - - - - - + + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - - - - + + + + + + + + + + + - - - - - + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + From 64a376f527ed5e8748dd32e6069daa49cbf735a6 Mon Sep 17 00:00:00 2001 From: alicebyers5 Date: Tue, 30 May 2023 15:54:22 +0100 Subject: [PATCH 6/6] Increment package version --- DESCRIPTION | 2 +- NEWS.md | 14 +++----------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 5b9dfcf..7c49cfb 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: sgplot Title: Graphic Styles and Colours for Scottish Government Plots -Version: 0.0.0.9001 +Version: 0.1.0 Authors@R: c( person("Scottish Government", , , "statistics.enquiries@gov.scot", role = c("cph", "fnd")), person("Alice", "Byers", , "alice.byers@gov.scot", c("aut", "cre")) diff --git a/NEWS.md b/NEWS.md index 4d9fd31..1d43d76 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,13 +1,5 @@ -## sgplot 0.0.0.9001 +# sgplot 0.1.0 -* Developments to `theme_sg()` following testing feedback -* Add [cookbook](https://datasciencescotland.github.io/sgplot/articles/cookbook.html) to pkgdown site -* Add [saving charts](https://datasciencescotland.github.io/sgplot/articles/saving.html) article to pkgdown site -* Add `mm_to_inch()` helper function -* Remove use of showtext package for Google font - -## sgplot 0.0.0.9000 - -* First development version for testing +* First package release * Add functions to create accessible plots using `ggplot2` -* Add pkgdown site (https://datasciencescotland.github.io/sgplot) +* Add pkgdown site (https://datasciencescotland.github.io/sgplot) including [cookbook](https://datasciencescotland.github.io/sgplot/articles/cookbook.html)