Skip to content

Commit

Permalink
refactor: use terra raster as input and remove former example dataset
Browse files Browse the repository at this point in the history
  • Loading branch information
rCarto committed Nov 28, 2023
1 parent 9d920a1 commit 12f18f2
Show file tree
Hide file tree
Showing 22 changed files with 494 additions and 465 deletions.
3 changes: 3 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
^\.travis\.yml$
^\.github$
^codecov\.yml$
^README\.Rmd$
^CITATION\.cff$
^codemeta\.json$
79 changes: 20 additions & 59 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
# 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
# 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
branches: [main, master]
pull_request:
branches:
- main
- master
branches: [main, master]

name: R-CMD-check

Expand All @@ -22,67 +18,32 @@ jobs:
fail-fast: false
matrix:
config:
- {os: macos-latest, r: 'release'}
- {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"}
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'}
- {os: ubuntu-latest, r: 'release'}
- {os: ubuntu-latest, r: 'oldrel-1'}

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

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@v1
- 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-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
- uses: r-lib/actions/setup-r-dependencies@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"))')
extra-packages: any::rcmdcheck
needs: check

- 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: 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
- uses: r-lib/actions/check-r-package@v2
with:
name: ${{ runner.os }}-r${{ matrix.config.r }}-results
path: check

- name: Test coverage
run: covr::codecov()
shell: Rscript {0}
upload-snapshots: true
38 changes: 38 additions & 0 deletions .github/workflows/test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 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: test-coverage

jobs:
test-coverage:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

steps:
- uses: actions/checkout@v3

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::covr
needs: coverage

- name: Test coverage
run: |
covr::codecov(
quiet = FALSE,
clean = FALSE,
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package")
)
shell: Rscript {0}


90 changes: 90 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# -----------------------------------------------------------
# CITATION file created with {cffr} R package, v0.5.0
# See also: https://docs.ropensci.org/cffr/
# -----------------------------------------------------------

cff-version: 1.2.0
message: 'To cite package "linemap" in publications use:'
type: software
license: GPL-3.0-only
title: 'linemap: Line Maps'
version: 0.3.0
abstract: 'Create maps made of lines. The package contains one function: linemap().
linemap() displays a map made of lines using a raster or gridded data.'
authors:
- family-names: Giraud
given-names: Timothée
email: [email protected]
orcid: https://orcid.org/0000-0002-1932-3323
repository: https://CRAN.R-project.org/package=linemap
repository-code: https://github.com/riatelab/linemap
url: https://github.com/riatelab/linemap
contact:
- family-names: Giraud
given-names: Timothée
email: [email protected]
orcid: https://orcid.org/0000-0002-1932-3323
keywords:
- cp1919
- map
- r
- spatial
references:
- type: software
title: 'R: A Language and Environment for Statistical Computing'
notes: Depends
url: https://www.R-project.org/
authors:
- name: R Core Team
location:
name: Vienna, Austria
year: '2023'
institution:
name: R Foundation for Statistical Computing
version: '>= 3.3.0'
- type: software
title: graphics
abstract: 'R: A Language and Environment for Statistical Computing'
notes: Imports
authors:
- name: R Core Team
location:
name: Vienna, Austria
year: '2023'
institution:
name: R Foundation for Statistical Computing
- type: software
title: terra
abstract: 'terra: Spatial Data Analysis'
notes: Imports
url: https://rspatial.org/
repository: https://CRAN.R-project.org/package=terra
authors:
- family-names: Hijmans
given-names: Robert J.
email: [email protected]
orcid: https://orcid.org/0000-0001-5872-2872
year: '2023'
- type: software
title: tinytest
abstract: 'tinytest: Lightweight and Feature Complete Unit Testing Framework'
notes: Suggests
url: https://github.com/markvanderloo/tinytest
repository: https://CRAN.R-project.org/package=tinytest
authors:
- family-names: van der Loo
given-names: Mark
email: [email protected]
orcid: https://orcid.org/0000-0002-9807-4686
year: '2023'
- type: software
title: covr
abstract: 'covr: Test Coverage for Packages'
notes: Suggests
url: https://covr.r-lib.org
repository: https://CRAN.R-project.org/package=covr
authors:
- family-names: Hester
given-names: Jim
email: [email protected]
year: '2023'
14 changes: 6 additions & 8 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
Package: linemap
Type: Package
Title: Line Maps
Version: 0.3.0.0
Version: 0.3.0
Authors@R: person("Timothée", "Giraud", email = "[email protected]",
role = c("cre","aut"), comment = c(ORCID = "0000-0002-1932-3323"))
Description: Create maps made of lines. The package contains two functions:
linemap() and getgrid(). linemap() displays a map made of lines using a
data frame of gridded data. getgrid() transforms a set of polygons
(sf objects) into a suitable data frame for linemap().
Description: Create maps made of lines. The package contains one function:
linemap(). linemap() displays a map made of lines using a
raster or gridded data.
URL: https://github.com/riatelab/linemap
BugReports: https://github.com/riatelab/linemap/issues
Depends: R (>= 3.3.0)
Imports: graphics, sf, stats
Imports: graphics, terra
Suggests: tinytest, covr
License: GPL-3
Encoding: UTF-8
LazyData: true
RoxygenNote: 7.1.2
RoxygenNote: 7.2.3
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by roxygen2: do not edit by hand

export(getgrid)
export(linemap)
importFrom(graphics,par)
8 changes: 8 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# linemap 0.3.0

## Major change

- Use terra raster as input
- remove former example dataset


# linemap 0.2.0

## Minor changes
Expand Down
84 changes: 0 additions & 84 deletions R/getgrid.R

This file was deleted.

Loading

0 comments on commit 12f18f2

Please sign in to comment.