Skip to content

Commit

Permalink
overhaul. Did the following:
Browse files Browse the repository at this point in the history
- cleaned up all documentation / errors so package checks cleanly
- documented data
- added Github actions
  • Loading branch information
ericward-noaa committed Feb 24, 2021
1 parent f06b6bb commit 5f160c1
Show file tree
Hide file tree
Showing 76 changed files with 3,810 additions and 2,534 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Expand Up @@ -3,3 +3,5 @@
^.*\.Rproj$
^\.Rproj\.user$
^Examples/
^.*\.rds$
^\.github$
512 changes: 512 additions & 0 deletions .Rhistory

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions .github/.gitignore
@@ -0,0 +1 @@
*.html
86 changes: 86 additions & 0 deletions .github/workflows/R-CMD-check.yaml
@@ -0,0 +1,86 @@
# For help debugging build failures open an issue on the RStudio community with the 'github-actions' tag.
# https://community.rstudio.com/new-topic?category=Package%20development&tags=github-actions
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: windows-latest, r: 'release'}
- {os: macOS-latest, r: 'release'}
- {os: ubuntu-20.04, r: 'release', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}
- {os: ubuntu-20.04, r: 'devel', rspm: "https://packagemanager.rstudio.com/cran/__linux__/focal/latest"}

env:
R_REMOTES_NO_ERRORS_FROM_WARNINGS: true
RSPM: ${{ matrix.config.rspm }}
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v1
with:
r-version: ${{ matrix.config.r }}

- uses: r-lib/actions/setup-pandoc@v1

- name: Query dependencies
run: |
install.packages('remotes')
saveRDS(remotes::dev_package_deps(dependencies = TRUE), ".github/depends.Rds", version = 2)
writeLines(sprintf("R-%i.%i", getRversion()$major, getRversion()$minor), ".github/R-version")
shell: Rscript {0}

- name: Cache R packages
if: runner.os != 'Windows'
uses: actions/cache@v2
with:
path: ${{ env.R_LIBS_USER }}
key: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-${{ hashFiles('.github/depends.Rds') }}
restore-keys: ${{ runner.os }}-${{ hashFiles('.github/R-version') }}-1-

- name: Install system dependencies
if: runner.os == 'Linux'
run: |
while read -r cmd
do
eval sudo $cmd
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
- name: Install dependencies
run: |
remotes::install_deps(dependencies = TRUE)
remotes::install_cran("rcmdcheck")
shell: Rscript {0}

- name: Check
env:
_R_CHECK_CRAN_INCOMING_REMOTE_: false
run: |
options(crayon.enabled = TRUE)
rcmdcheck::rcmdcheck(args = c("--no-manual", "--as-cran"), error_on = "warning", check_dir = "check")
shell: Rscript {0}

- name: Upload check results
if: failure()
uses: actions/upload-artifact@main
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check
4 changes: 4 additions & 0 deletions .gitignore
Expand Up @@ -2,3 +2,7 @@ Meta
doc
inst/doc
.Rproj.user
.DS_Store
wcbts_bio_2019-08-01.rds
wcbts_catch_2019-08-01.rds
wcbts_haul_2019-08-01.rds
24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

11 changes: 7 additions & 4 deletions DESCRIPTION
Expand Up @@ -25,11 +25,14 @@ Imports:
jsonlite,
kableExtra,
reshape2,
ggplot2,
xtable
ggplot2 (>= 3.0.0),
xtable,
rlang,
rnaturalearth
Depends:
dplyr (>= 0.8.0),
R (>= 2.10)
dplyr (>= 1.0.0),
R (>= 4.0)
Encoding: UTF-8
VignetteBuilder: knitr
RoxygenNote: 7.1.1
LazyData: true
8 changes: 8 additions & 0 deletions NAMESPACE
Expand Up @@ -31,6 +31,7 @@ export(SurveyAgeAtLen.fn)
export(SurveyLFs.fn)
export(UnexpandedAFs.fn)
export(UnexpandedLFs.fn)
export(age_representativeness_plot)
export(createMatrix)
import(chron)
import(ggplot2)
Expand All @@ -39,18 +40,25 @@ import(reshape2)
importFrom(dplyr,left_join)
importFrom(dplyr,rename)
importFrom(grDevices,dev.off)
importFrom(grDevices,gray)
importFrom(grDevices,png)
importFrom(grDevices,rgb)
importFrom(graphics,abline)
importFrom(graphics,axis)
importFrom(graphics,grid)
importFrom(graphics,hist)
importFrom(graphics,legend)
importFrom(graphics,mtext)
importFrom(graphics,par)
importFrom(graphics,plot)
importFrom(graphics,points)
importFrom(graphics,segments)
importFrom(graphics,symbols)
importFrom(rlang,current_env)
importFrom(rnaturalearth,ne_states)
importFrom(stats,optim)
importFrom(stats,qnorm)
importFrom(stats,quantile)
importFrom(stats,sd)
importFrom(stats,var)
importFrom(utils,write.csv)

0 comments on commit 5f160c1

Please sign in to comment.