Skip to content

Commit

Permalink
Merge branch 'master' into terra
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbacchus authored Oct 4, 2024
2 parents f75a390 + 196dbfd commit d8b1111
Show file tree
Hide file tree
Showing 43 changed files with 974 additions and 404 deletions.
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ man-roxygen
^\.github$
^vignettes/articles$
^CRAN-RELEASE$
figure/
33 changes: 25 additions & 8 deletions .github/workflows/Deploy-pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,36 @@ jobs:
steps:
- uses: actions/checkout@v2

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

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

- uses: r-lib/actions/setup-r-dependencies@v1
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: pkgdown
extra-packages: |
RandomFields=?ignore
any::pkgdown
any::XML
needs: website

- name: Deploy package
- name: Install additional package dependencies
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "$GITHUB_ACTOR@users.noreply.github.com"
Rscript -e 'pkgdown::deploy_to_branch(new_process = FALSE)'
repos.orig <- getOption('repos')
options(repos = c(PE = "https://predictiveecology.r-universe.dev")) ## TODO: use ropensci universe
pak::pkg_install("RandomFields")
options(repos = repos.orig)
shell: Rscript {0}

- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}

- name: Deploy to GitHub pages 🚀
if: github.event_name != 'pull_request'
uses: JamesIves/github-pages-deploy-action@4.1.4
with:
clean: false
branch: gh-pages
folder: docs
25 changes: 18 additions & 7 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,31 @@ jobs:
steps:
- uses: actions/checkout@v2

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

- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-r@v2
with:
extra-repositories: 'https://predictiveecology.r-universe.dev' ## TODO: use ropensci universe
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v1
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: rcmdcheck
extra-packages: |
RandomFields=?ignore
any::rcmdcheck
any::XML
- name: Install additional package dependencies
run: |
repos.orig <- getOption('repos')
options(repos = c(PE = "https://predictiveecology.r-universe.dev")) ## TODO: use ropensci universe
pak::pkg_install("RandomFields")
options(repos = repos.orig)
shell: Rscript {0}

- uses: r-lib/actions/check-r-package@v2

- uses: r-lib/actions/check-r-package@v1

- name: Show testthat output
if: always()
run: find check -name 'testthat.Rout*' -exec cat '{}' \; || true
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/Render-readme.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,19 @@ jobs:
with:
fetch-depth: 0

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

- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-r@v2
with:
extra-repositories: 'https://predictiveecology.r-universe.dev' ## TODO: use ropensci universe
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v1
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: rmarkdown
extra-packages: |
RandomFields=?ignore
any::rmarkdown
any::XML
- name: Render README files
run: Rscript -e 'rmarkdown::render("README.Rmd")'
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/Test-coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,16 @@ jobs:
steps:
- uses: actions/checkout@v2

- uses: r-lib/actions/setup-r@v1
- uses: r-lib/actions/setup-r@v2
with:
extra-repositories: 'https://predictiveecology.r-universe.dev' ## TODO: use ropensci universe
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v1
- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: covr
extra-packages: |
any::covr
any::XML
- name: Test coverage
run: covr::codecov()
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/Write-codemeta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help

on:
push:
paths: ['DESCRIPTION']

name: Write-codemeta

jobs:
render-readme:
runs-on: ubuntu-latest
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repo
uses: actions/checkout@v2
with:
fetch-depth: 0

- uses: r-lib/actions/setup-r@v2

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: codemeta

- name: Write codemeta file
run: Rscript -e 'codemeta::write_codemeta()'

- name: Commit codemeta file
run: |
git config --local user.email "actions@github.com"
git config --local user.name "GitHub Actions"
git add codemeta.json
git commit -m "Re-write codemeta.json" || echo "No changes to commit"
git push origin || echo "No changes to commit"
105 changes: 61 additions & 44 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,65 +1,82 @@
Package: NLMR
Type: Package
Package: NLMR
Title: Simulating Neutral Landscape Models
Version: 1.1
Authors@R: c(person("Marco", "Sciaini", email = "marco.sciaini@posteo.net", role = c("aut", "cre"), comment = c(ORCID = '0000-0002-3042-5435')),
person("Matthias", "Fritsch", email = "matthias.fritsch@forst.uni-goettingen.de", role = "aut"),
person("Maximilian", "Hesselbarth", email = "mhk.hesselbarth@gmail.com", role = "aut"),
person("Craig", "Simpkins", email = "simpkinscraig063@gmail.com",
role = "aut", comment = c(ORCID = '0000-0003-3212-1379')),
person("Cédric", "Scherer", email = "cedricphilippscherer@gmail.com",
role = c("aut"), comment = c(ORCID = '0000-0003-0465-2543')),
person("Sebastian", "Hanß", role = "aut", comment = c(ORCID = '0000-0002-3990-4897')),
Version: 1.1.1
Authors@R: c(
person("Marco", "Sciaini", , "marco.sciaini@posteo.net", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-3042-5435")),
person("Matthias", "Fritsch", , "matthias.fritsch@forst.uni-goettingen.de", role = "aut"),
person("Maximilian", "Hesselbarth", , "mhk.hesselbarth@gmail.com", role = "aut"),
person("Craig", "Simpkins", , "simpkinscraig063@gmail.com", role = "aut",
comment = c(ORCID = "0000-0003-3212-1379")),
person("Cédric", "Scherer", , "cedricphilippscherer@gmail.com", role = "aut",
comment = c(ORCID = "0000-0003-0465-2543")),
person("Sebastian", "Hanß", role = "aut",
comment = c(ORCID = "0000-0002-3990-4897")),
person("Laura", "Graham", role = "rev",
comment = "Laura reviewed the package for rOpenSci, see
https://github.com/ropensci/onboarding/issues/188"),
comment = "Laura reviewed the package for rOpenSci, see \n https://github.com/ropensci/onboarding/issues/188"),
person("Jeffrey", "Hollister", role = "rev",
comment = "Jeffrey reviewed the package for rOpenSci, see
https://github.com/ropensci/onboarding/issues/188"))
comment = "Jeffrey reviewed the package for rOpenSci, see \n https://github.com/ropensci/onboarding/issues/188")
)
Maintainer: Marco Sciaini <marco.sciaini@posteo.net>
Description: Provides neutral landscape models (<doi:10.1007/BF02275262>,
<http://sci-hub.tw/10.1007/bf02275262>).
Neutral landscape models range from "hard"
neutral models (completely random distributed), to "soft" neutral models
(definable spatial characteristics) and generate landscape patterns that are
independent of ecological processes.
Thus, these patterns can be used as null models in landscape ecology. 'NLMR'
combines a large number of algorithms from other published software for
simulating neutral landscapes. The simulation results are obtained in a
spatial data format (raster* objects from the 'raster' package) and can,
therefore, be used in any sort of raster data operation that is performed
with standard observation data.
<http://sci-hub.tw/10.1007/bf02275262>). Neutral landscape models
range from "hard" neutral models (completely random distributed), to
"soft" neutral models (definable spatial characteristics) and generate
landscape patterns that are independent of ecological processes.
Thus, these patterns can be used as null models in landscape ecology.
'NLMR' combines a large number of algorithms from other published
software for simulating neutral landscapes. The simulation results are
obtained in a spatial data format (raster* objects from the 'raster'
package) and can, therefore, be used in any sort of raster data
operation that is performed with standard observation data.
License: GPL-3
Encoding: UTF-8
LazyData: true
ByteCompile: true
URL: https://ropensci.github.io/NLMR/
BugReports: https://github.com/ropensci/NLMR/issues/
Depends:
R (>= 3.1.0)
SystemRequirements: C++11
Roxygen: list(roclets = c("rd", "namespace", "collate"))
RoxygenNote: 7.1.1
Imports:
checkmate,
dplyr,
RandomFields,
fasterize,
raster,
spatstat.core,
Rcpp,
sf,
spatstat.random,
spatstat.geom,
igraph,
stats,
tibble,
fasterize,
sf,
Rcpp,
terra
URL: https://ropensci.github.io/NLMR/
BugReports: https://github.com/ropensci/NLMR/issues/
Suggests:
testthat,
covr,
ggplot2,
highcharter,
knitr,
kableExtra,
landscapemetrics,
landscapetools,
magrittr,
pals,
plotly,
purrr,
RandomFields,
RandomFieldsUtils,
rasterVis,
rayshader,
rgl,
rmarkdown,
lintr,
landscapetools
LinkingTo: Rcpp
VignetteBuilder: knitr
testthat,
viridis
LinkingTo:
Rcpp
VignetteBuilder:
knitr
Additional_repositories: https://predictiveecology.r-universe.dev/
ByteCompile: true
Config/Needs/website: bindrcpp, igraph, landscapemetrics, rasterVis, pals,
rgl, viridis, plotly, rayshader
Encoding: UTF-8
LazyData: true
Roxygen: list(roclets = c("rd", "namespace", "collate"))
RoxygenNote: 7.2.1
SystemRequirements: C++11
9 changes: 8 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
____________________________________________________________________________________
## NLMR 1.1.1 Release Notes

- Adding onload function and help for users that dont have `RandomFields`

## NLMR 1.1.0.9000 Release Notes

- move `RandomFields` and `RandomFieldsUtils` to Suggests and use AdditionalRepositories to provide these packages since they are no longer available from CRAN (with #95)

## NLMR 0.4.2 Release Notes

- Bugfix in nlm_mosaicfield to rely on new version of RandomFields
Expand Down
6 changes: 6 additions & 0 deletions NLMR.Rproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ Encoding: UTF-8
RnwWeave: Sweave
LaTeX: pdfLaTeX

AutoAppendNewline: Yes
StripTrailingWhitespace: Yes

BuildType: Package
PackageUseDevtools: Yes
PackageInstallArgs: --no-multiarch --with-keep.source
PackageRoxygenize: rd,collate,namespace

QuitChildProcessesOnExit: Yes
1 change: 1 addition & 0 deletions R/NLMR.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#'
#' @useDynLib NLMR, .registration=TRUE
#' @importFrom Rcpp sourceCpp
#' @keywords internal
# nocov start
# nolint start
"_PACKAGE"
Expand Down
5 changes: 4 additions & 1 deletion R/nlm_fbm.R
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,16 @@
#'
#' @export
#'

nlm_fbm <- function(ncol,
nrow,
resolution = 1,
fract_dim = 1,
user_seed = NULL,
rescale = TRUE,
...) {

hasData()

# Check function arguments ----
checkmate::assert_count(ncol, positive = TRUE)
checkmate::assert_count(nrow, positive = TRUE)
Expand Down Expand Up @@ -105,4 +107,5 @@ nlm_fbm <- function(ncol,
}

return(fbm_raster)

}
3 changes: 2 additions & 1 deletion R/nlm_gaussianfield.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
#'
#' @export
#'

nlm_gaussianfield <- function(ncol,
nrow,
resolution = 1,
Expand All @@ -61,6 +60,8 @@ nlm_gaussianfield <- function(ncol,
user_seed = NULL,
rescale = TRUE) {

hasData()

# Check function arguments ----
checkmate::assert_count(ncol, positive = TRUE)
checkmate::assert_count(nrow, positive = TRUE)
Expand Down
Loading

0 comments on commit d8b1111

Please sign in to comment.