From 49c96588744f87125d3b1f0309048dc102131078 Mon Sep 17 00:00:00 2001 From: Simon Dedman Date: Wed, 23 Aug 2023 14:42:41 -0700 Subject: [PATCH] readme and citation --- .github/.gitignore | 1 + .github/workflows/R-CMD-check.yaml | 49 ++++++++++++++++++++++++++++++ DESCRIPTION | 14 +++++++-- NEWS.md | 3 ++ R/data.R | 18 ++++------- R/gbm.mapsf.R | 1 + README.Rmd | 2 +- README.md | 2 +- inst/CITATION | 12 ++++++++ man/Juveniles.Rd | 9 ++---- man/gbm.mapsf.Rd | 2 ++ man/grids.Rd | 9 ++---- 12 files changed, 93 insertions(+), 29 deletions(-) create mode 100644 .github/.gitignore create mode 100644 .github/workflows/R-CMD-check.yaml create mode 100644 inst/CITATION diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 0000000..2d19fc7 --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/.github/workflows/R-CMD-check.yaml b/.github/workflows/R-CMD-check.yaml new file mode 100644 index 0000000..a3ac618 --- /dev/null +++ b/.github/workflows/R-CMD-check.yaml @@ -0,0 +1,49 @@ +# 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: + branches: [main, master] + pull_request: + branches: [main, master] + +name: R-CMD-check + +jobs: + R-CMD-check: + runs-on: ${{ matrix.config.os }} + + name: ${{ matrix.config.os }} (${{ matrix.config.r }}) + + strategy: + fail-fast: false + matrix: + config: + - {os: macos-latest, r: 'release'} + - {os: windows-latest, r: 'release'} + - {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} + - {os: ubuntu-latest, r: 'release'} + - {os: ubuntu-latest, r: 'oldrel-1'} + + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + R_KEEP_PKG_SOURCE: yes + + steps: + - uses: actions/checkout@v3 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + r-version: ${{ matrix.config.r }} + http-user-agent: ${{ matrix.config.http-user-agent }} + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::rcmdcheck + needs: check + + - uses: r-lib/actions/check-r-package@v2 + with: + upload-snapshots: true diff --git a/DESCRIPTION b/DESCRIPTION index 3205dd5..e83f6ce 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: gbm.auto Title: Automated Boosted Regression Tree Modelling and Mapping Suite -Version: 2023.08.15 +Version: 2023.08.23 Authors@R: person("Simon", "Dedman", , "simondedman@gmail.com", role = c("aut", "cre"), comment = c(ORCID = "0000-0002-9108-972X")) Description: Automates delta log-normal boosted regression tree abundance prediction. Loops through parameters provided (LR (learning rate), TC @@ -23,13 +23,21 @@ Imports: dismo (>= 1.3-14), dplyr (>= 1.0.9), gbm (>= 2.1.1), + ggmap (>= 3.0.2), + ggplot2 (>= 3.4.3), + ggspatial (>= 1.1.9), lifecycle, + lubridate (>= 1.9.2), mapplots (>= 1.5), Metrics (>= 0.1.4), + readr (>= 2.1.4), sf (>= 0.9-7), - shapefiles (>= 0.7), + stars (>= 0.6-3), + starsExtra (>= 0.2.7), stats (>= 3.3.1), - stringi (>= 1.6.1) + stringi (>= 1.6.1), + tidyselect (>= 1.2.0), + viridis (>= 0.6.4) Encoding: UTF-8 Language: en-GB LazyData: true diff --git a/NEWS.md b/NEWS.md index d2aaf85..cbf110b 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,9 @@ author: "Simon Dedman" date: "2023-05-25" output: html_document --- +# v2023.08.23 +* citation added, various improvements and cleans, CRAN push + # v2023.08.14 * gbm.factorplot finished, included in gbm.auto, documented. lifecycle package used for function status. diff --git a/R/data.R b/R/data.R index d436976..e521343 100644 --- a/R/data.R +++ b/R/data.R @@ -70,12 +70,9 @@ #' \item{Distance_to_Shore}{Metres, decimal} #' \item{F_LPUE}{Commercial fishery LPUE in Kg/Hr} #' \item{Scallop}{Average KwH Scallop effort from logbooks, Marine Institute and MMO combined} -#' \item{MI_Av_E_Hr}{Average effort hours, Marine Institute Scallop VMS, -#' 0.03*0.02 rectangles, all Irish Sea, 2006-14} -#' \item{MI_Av_LPUE}{Average scallop CPUE, Marine Institute Scallop VMS, -#' 0.03*0.02 rectangles, all Irish Sea, 2006-14} -#' \item{MI_Sum_Liv}{Sum of live weight. Average scallop CPUE, Marine Institute Scallop VMS, -#' 0.03*0.02 rectangles, all Irish Sea, 2006-14} +#' \item{MI_Av_E_Hr}{Average effort hours, Marine Institute Scallop VMS, 0.03 x 0.02 rectangles, all Irish Sea, 2006-14} +#' \item{MI_Av_LPUE}{Average scallop CPUE, Marine Institute Scallop VMS, 0.03 x 0.02 rectangles, all Irish Sea, 2006-14} +#' \item{MI_Sum_Liv}{Sum of live weight. Average scallop CPUE, Marine Institute Scallop VMS, 0.03 x 0.02 rectangles, all Irish Sea, 2006-14} #' \item{Whelk}{MMO Whelk LPUE 2009-12, pivot, polygons to points} #' \item{MmoAvScKwh}{MMO Scallop Effort 2009-12, pivot, polygons to points. ICES rectangles} #' \item{Cod_C}{ICES IBTS CPUE of cod caught between 1994 - 2014 large enough to predate upon <= year 1 cuckoo rays} @@ -134,12 +131,9 @@ #' \item{Distance_to_Shore}{Metres, decimal} #' \item{F_LPUE}{Commercial fishery LPUE in Kg/Hr} #' \item{Scallop}{Average KwH Scallop effort from logbooks, Marine Institute and MMO combined} -#' \item{MI_Av_E_Hr}{Average effort hours, Marine Institute Scallop VMS, -#' 0.03*0.02 rectangles, all Irish Sea, 2006-14} -#' \item{MI_Av_LPUE}{Average scallop CPUE, Marine Institute Scallop VMS, -#' 0.03*0.02 rectangles, all Irish Sea, 2006-14} -#' \item{MI_Sum_Liv}{Sum of live weight. Average scallop CPUE, Marine Institute Scallop VMS, -#' 0.03*0.02 rectangles, all Irish Sea, 2006-14} +#' \item{MI_Av_E_Hr}{Average effort hours, Marine Institute Scallop VMS, 0.03 x 0.02 rectangles, all Irish Sea, 2006-14} +#' \item{MI_Av_LPUE}{Average scallop CPUE, Marine Institute Scallop VMS, 0.03 x 0.02 rectangles, all Irish Sea, 2006-14} +#' \item{MI_Sum_Liv}{Sum of live weight. Average scallop CPUE, Marine Institute Scallop VMS, 0.03 x 0.02 rectangles, all Irish Sea, 2006-14} #' \item{Whelk}{MMO Whelk LPUE 2009-12, pivot, polygons to points} #' \item{MmoAvScKwh}{MMO Scallop Effort 2009-12, pivot, polygons to points. ICES rectangles} #' \item{HubDist}{map calc, distance of grid point to nearest datras point representing it (for preds)} diff --git a/R/gbm.mapsf.R b/R/gbm.mapsf.R index 0c7dd31..b3b7ac5 100644 --- a/R/gbm.mapsf.R +++ b/R/gbm.mapsf.R @@ -41,6 +41,7 @@ #' Default 9. #' @param shape If mapsource is "gbm.basemap", enter the full path to gbm.basemaps downloaded map, #' typically Crop_Map.shp, including the .shp. Default NULL. +#' @param expandfactor Extents expansion factor for basemap. default 0. #' @param colourscale Scale fill colour scheme to use, default "viridis", other option is #' "gradient". #' @param colorscale Scale fill colour scheme to use, default NULL, populating this will overwrite diff --git a/README.Rmd b/README.Rmd index 8972fce..999c058 100644 --- a/README.Rmd +++ b/README.Rmd @@ -16,7 +16,7 @@ knitr::opts_chunk$set( # gbm.auto -[![R-CMD-check](https://github.com/SimonDedman/gbm.auto/workflows/R-CMD-check--as-cran/badge.svg)](https://github.com/SimonDedman/gbm.auto/actions) +[![R-CMD-check](https://github.com/SimonDedman/gbm.auto/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/SimonDedman/gbm.auto/actions/workflows/R-CMD-check.yaml) [![CRAN\_Status\_Badge](https://www.r-pkg.org/badges/version/gbm.auto)](https://cran.r-project.org/package=gbm.auto) [![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/gbm.auto)](https://cran.r-project.org/package=gbm.auto) diff --git a/README.md b/README.md index 4abd3a5..6835906 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ -[![R-CMD-check](https://github.com/SimonDedman/gbm.auto/workflows/R-CMD-check--as-cran/badge.svg)](https://github.com/SimonDedman/gbm.auto/actions) +[![R-CMD-check](https://github.com/SimonDedman/gbm.auto/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/SimonDedman/gbm.auto/actions/workflows/R-CMD-check.yaml) [![CRAN_Status_Badge](https://www.r-pkg.org/badges/version/gbm.auto)](https://cran.r-project.org/package=gbm.auto) [![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/gbm.auto)](https://cran.r-project.org/package=gbm.auto) diff --git a/inst/CITATION b/inst/CITATION new file mode 100644 index 0000000..2b057c4 --- /dev/null +++ b/inst/CITATION @@ -0,0 +1,12 @@ +bibentry( + bibtype = "Article", + title = "Gbm.auto: A software tool to simplify spatial modelling and Marine Protected Area planning", + author = "Dedman, Simon and Officer, Rick and Clarke, Maurice and Reid, David G and Brophy, Deirdre", + journal = "PloS ONE", + year = "2017", + volume = "12", + number = "12", + pages = "e0188955", + doi = "https://doi.org/10.1371/journal.pone.0188955", + url = "https://github.com/SimonDedman/gbm.auto" +) diff --git a/man/Juveniles.Rd b/man/Juveniles.Rd index 334522d..3b8122a 100644 --- a/man/Juveniles.Rd +++ b/man/Juveniles.Rd @@ -17,12 +17,9 @@ A data frame with 2136 rows and 46 variables: \item{Distance_to_Shore}{Metres, decimal} \item{F_LPUE}{Commercial fishery LPUE in Kg/Hr} \item{Scallop}{Average KwH Scallop effort from logbooks, Marine Institute and MMO combined} -\item{MI_Av_E_Hr}{Average effort hours, Marine Institute Scallop VMS, -0.03\emph{0.02 rectangles, all Irish Sea, 2006-14} -\item{MI_Av_LPUE}{Average scallop CPUE, Marine Institute Scallop VMS, -0.03}0.02 rectangles, all Irish Sea, 2006-14} -\item{MI_Sum_Liv}{Sum of live weight. Average scallop CPUE, Marine Institute Scallop VMS, -0.03*0.02 rectangles, all Irish Sea, 2006-14} +\item{MI_Av_E_Hr}{Average effort hours, Marine Institute Scallop VMS, 0.03 x 0.02 rectangles, all Irish Sea, 2006-14} +\item{MI_Av_LPUE}{Average scallop CPUE, Marine Institute Scallop VMS, 0.03 x 0.02 rectangles, all Irish Sea, 2006-14} +\item{MI_Sum_Liv}{Sum of live weight. Average scallop CPUE, Marine Institute Scallop VMS, 0.03 x 0.02 rectangles, all Irish Sea, 2006-14} \item{Whelk}{MMO Whelk LPUE 2009-12, pivot, polygons to points} \item{MmoAvScKwh}{MMO Scallop Effort 2009-12, pivot, polygons to points. ICES rectangles} \item{Cod_C}{ICES IBTS CPUE of cod caught between 1994 - 2014 large enough to predate upon <= year 1 cuckoo rays} diff --git a/man/gbm.mapsf.Rd b/man/gbm.mapsf.Rd index 2be26fa..1ecb78b 100644 --- a/man/gbm.mapsf.Rd +++ b/man/gbm.mapsf.Rd @@ -101,6 +101,8 @@ Default 9.} \item{shape}{If mapsource is "gbm.basemap", enter the full path to gbm.basemaps downloaded map, typically Crop_Map.shp, including the .shp. Default NULL.} +\item{expandfactor}{Extents expansion factor for basemap. default 0.} + \item{colourscale}{Scale fill colour scheme to use, default "viridis", other option is "gradient".} diff --git a/man/grids.Rd b/man/grids.Rd index 3413936..800f55f 100644 --- a/man/grids.Rd +++ b/man/grids.Rd @@ -16,12 +16,9 @@ A data frame with 378570 rows and 43 variables: \item{Distance_to_Shore}{Metres, decimal} \item{F_LPUE}{Commercial fishery LPUE in Kg/Hr} \item{Scallop}{Average KwH Scallop effort from logbooks, Marine Institute and MMO combined} -\item{MI_Av_E_Hr}{Average effort hours, Marine Institute Scallop VMS, -0.03\emph{0.02 rectangles, all Irish Sea, 2006-14} -\item{MI_Av_LPUE}{Average scallop CPUE, Marine Institute Scallop VMS, -0.03}0.02 rectangles, all Irish Sea, 2006-14} -\item{MI_Sum_Liv}{Sum of live weight. Average scallop CPUE, Marine Institute Scallop VMS, -0.03*0.02 rectangles, all Irish Sea, 2006-14} +\item{MI_Av_E_Hr}{Average effort hours, Marine Institute Scallop VMS, 0.03 x 0.02 rectangles, all Irish Sea, 2006-14} +\item{MI_Av_LPUE}{Average scallop CPUE, Marine Institute Scallop VMS, 0.03 x 0.02 rectangles, all Irish Sea, 2006-14} +\item{MI_Sum_Liv}{Sum of live weight. Average scallop CPUE, Marine Institute Scallop VMS, 0.03 x 0.02 rectangles, all Irish Sea, 2006-14} \item{Whelk}{MMO Whelk LPUE 2009-12, pivot, polygons to points} \item{MmoAvScKwh}{MMO Scallop Effort 2009-12, pivot, polygons to points. ICES rectangles} \item{HubDist}{map calc, distance of grid point to nearest datras point representing it (for preds)}