Skip to content

Commit

Permalink
Merge pull request #110 from r-spatialecology/main
Browse files Browse the repository at this point in the history
Update v2.0.1
  • Loading branch information
mhesselbarth authored Nov 1, 2022
2 parents 3f41d6b + 6df5597 commit 2357706
Show file tree
Hide file tree
Showing 18 changed files with 407 additions and 108 deletions.
31 changes: 14 additions & 17 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,15 @@
^CRAN-RELEASE$
^.*\.Rproj$
^\.Rproj\.user$
^README.*$
^cran-comments\.md$
^docs$
^CODE_OF_CONDUCT.*$
^vignettes/articles$
codecov.yml
codemeta.json
CODE_OF_CONDUCT.md
CONTRIBUTING.md
cran-comments.md
data-raw
docs
LICENSE.md
pkgdown
README.Rmd
README.md
shar.Rproj
vignettes/articles
^data-raw$
^_pkgdown\.yml$
^codecov\.yml$
^CONTRIBUTING.*$
^pkgdown$
^\.github$
^LICENSE\.md$
^CRAN-SUBMISSION$
^CODE_OF_CONDUCT\.md$
.github
_pkgdown.yml
20 changes: 13 additions & 7 deletions .github/workflows/Deploy-pkgdown.yaml
Original file line number Diff line number Diff line change
@@ -1,35 +1,41 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Workflow derived from https://github.com/r-lib/actions/tree/v2-branch/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help

on:
push:
branches: [main, development]
tags: ['*']
workflow_dispatch:

name: deploy-pkgdown

jobs:
deploy-pkgdown:
runs-on: ubuntu-latest
# Only restrict concurrency for non-PR jobs
concurrency:
group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }}

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

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

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

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
extra-repositories: 'http://packages.ropensci.org'

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::pkgdown, local::.
extra-packages: any::pkgdown, any::ggplot2, any::future, any::future.apply,
any::patchwork, any::rgbif, any::rgdal, any::rnaturalearth,
any::rnaturalearthdata, any::sf, local::.
needs: website

- name: Install getCRUCLdata
run: install.packages('getCRUCLdata', repos = 'http://packages.ropensci.org', typ = 'source')
shell: Rscript {0}

- name: Build site
run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE)
shell: Rscript {0}
Expand Down
7 changes: 3 additions & 4 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Workflow derived from https://github.com/r-lib/actions/tree/v2-branch/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [CRAN, main, development]
pull_request:
branches: [CRAN, main]
workflow_dispatch:

name: r-cmd-check

jobs:
r-cmd-check:
if: "!contains(github.event.commits[0].message, '[skip-ci]')"
runs-on: ${{ matrix.config.os }}

name: ${{ matrix.config.os }} (${{ matrix.config.r }})

strategy:
Expand All @@ -28,7 +28,7 @@ jobs:
R_KEEP_PKG_SOURCE: yes

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

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

Expand All @@ -37,7 +37,6 @@ jobs:
r-version: ${{ matrix.config.r }}
http-user-agent: ${{ matrix.config.http-user-agent }}
use-public-rspm: true
extra-repositories: 'http://packages.ropensci.org'

- uses: r-lib/actions/setup-r-dependencies@v2
with:
Expand Down
32 changes: 18 additions & 14 deletions .github/workflows/Render-README.yaml
Original file line number Diff line number Diff line change
@@ -1,35 +1,39 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Workflow derived from https://github.com/r-lib/actions/tree/v2-branch/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
paths: ['README.Rmd']
paths: ["README.Rmd"]
workflow_dispatch:

name: render-rmarkdown
name: render-readme

jobs:
render-rmarkdown:
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: actions/checkout@v3

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

- uses: r-lib/actions/setup-r@v2
with:
extra-repositories: 'http://packages.ropensci.org'
use-public-rspm: true

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rmarkdown, any::spatstat, any::terra

- uses: r-lib/actions/setup-renv@v2
- name: Render README files
run: Rscript -e 'rmarkdown::render("README.Rmd")'

- name: Render Rmarkdown files and Commit Results
- name: Commit README
run: |
RMD_PATH=($(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep '[.]Rmd$'))
Rscript -e 'for (f in commandArgs(TRUE)) if (file.exists(f)) rmarkdown::render(f)' ${RMD_PATH[*]}
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
git commit ${RMD_PATH[*]/.Rmd/.md} -m 'Re-build Rmarkdown files' || echo "No changes to commit"
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"
7 changes: 4 additions & 3 deletions .github/workflows/Test-coverage.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples
# Workflow derived from https://github.com/r-lib/actions/tree/v2-branch/examples
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help
on:
push:
branches: [CRAN, main, development]
pull_request:
branches: [CRAN, main]
workflow_dispatch:

name: test-coverage

jobs:
test-coverage:
if: "!contains(github.event.commits[0].message, '[skip-ci]')"
runs-on: ubuntu-latest

env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}

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

- uses: r-lib/actions/setup-r@v2
with:
use-public-rspm: true
extra-repositories: 'http://packages.ropensci.org'

- uses: r-lib/actions/setup-r-dependencies@v2
with:
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/Write-codemeta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help

on:
push:
paths: ['DESCRIPTION']
workflow_dispatch:

name: write-codemeta

jobs:
write-codemeta:
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

- name: Install codemeta
run: Rscript -e 'install.packages("codemeta")'

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

- name: Commit codemeta file
run: |
git config --local user.name "$GITHUB_ACTOR"
git config --local user.email "[email protected]"
git add codemeta.json
git commit -m "Re-write codemeta.json" || echo "No changes to commit"
git push origin || echo "No changes to commit"
16 changes: 3 additions & 13 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Type: Package
Package: shar
Title: Species-Habitat Associations
Version: 2.0.0
Authors@R: c(person("Maximillian H.K.", "Hesselbarth", email = "[email protected]",
Version: 2.0.1
Authors@R: c(person("Maximilian H.K.", "Hesselbarth", email = "[email protected]",
role = c("aut", "cre"), comment = c(ORCID = "0000-0003-1125-9918")),
person("Marco", "Sciaini", email = "[email protected]",
role = "aut", comment = c(ORCID = "0000-0002-3042-5435")),
Expand All @@ -11,7 +11,7 @@ Authors@R: c(person("Maximillian H.K.", "Hesselbarth", email = "mhk.hesselbarth@
person("Thomas", "Etherington", email = "[email protected]",
role = "ctb", comment = c(ORCID = "0000-0002-3187-075X"))
)
Maintainer: Maximillian H.K. Hesselbarth <[email protected]>
Maintainer: Maximilian H.K. Hesselbarth <[email protected]>
Description:
Analyse species-habitat associations in R. Therefore, information about the location
of the species (as a point pattern) is needed together with environmental conditions
Expand All @@ -37,18 +37,8 @@ RoxygenNote: 7.2.1
Suggests:
covr,
dplyr,
getCRUCLdata,
ggplot2,
future,
future.apply,
knitr,
patchwork,
rgbif,
rgdal,
rmarkdown,
rnaturalearth,
rnaturalearthdata,
sf,
spatstat (>= 2.0.0),
testthat (>= 2.1.0)
Additional_repositories: http://packages.ropensci.org
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# shar 2.0.1
* Improvements
* Better approach for external repo
* Various
* Fixing typo in maintainer name

# shar 2.0.0
* Improvements
* Using `terra` instead of `raster`
Expand Down
11 changes: 0 additions & 11 deletions R/onLoad.R

This file was deleted.

14 changes: 8 additions & 6 deletions README.Rmd
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
---
output: github_document
output:
github_document:
html_preview: false
---

<!-- README.md is generated from README.Rmd. Please edit that file -->
Expand All @@ -15,6 +17,8 @@ knitr::opts_chunk$set(

<!-- badges: start -->

Last updated: `r Sys.Date()`

| CI | Development | CRAN | License |
|----|-------------|------|---------|
| [![R-CMD-check](https://github.com/r-spatialecology/shar/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/r-spatialecology/shar/actions/workflows/R-CMD-check.yaml) | [![Project Status](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active) | [![CRAN status](https://www.r-pkg.org/badges/version/shar)](https://cran.r-project.org/package=shar) |[![JOSS](https://joss.theoj.org/papers/1b786c028a5425858cb0e5428bd9173b/status.svg)](https://joss.theoj.org/papers/1b786c028a5425858cb0e5428bd9173b) |
Expand Down Expand Up @@ -43,8 +47,7 @@ install.packages("shar")
And the development version from [GitHub](https://github.com/r-spatialecology/shar) with:

```{r install-github, eval = FALSE}
install.packages("remotes")
# install.packages("remotes")
remotes::install_github("r-spatialecology/shar")
```

Expand Down Expand Up @@ -98,7 +101,7 @@ Of course, there are several utility functions. For example, you can plot the su
plot(reconstruction, what = "pp")
```

Another utility functions allows to calculate the differences between the observed pattern and the randomized patterns (also called energy using summary functions).
Another utility function allows to calculate the differences between the observed pattern and the randomized patterns (also called energy using summary functions).

```{r calculate-energy, message = FALSE}
calculate_energy(reconstruction, return_mean = TRUE)
Expand All @@ -114,7 +117,6 @@ Furthermore, please be aware that due to the randomization of the null model dat
torus_trans <- unpack_randomized(torus_trans)
```


```{r results}
significance_level <- 0.01
Expand All @@ -129,7 +131,7 @@ Contributions to **shar** are highly welcomed and appreciated. This includes any

Please note that the **shar** package is released with a [Contributor Code of Conduct](CODE_OF_CONDUCT.md). By contributing to this project, you agree to abide by its terms.

To see how to contribute to this project, please see the [Contributing guidelines](CONTRIBUTING.md).
To contribute to this project, please see the [Contributing guidelines](CONTRIBUTING.md).

### References

Expand Down
Loading

0 comments on commit 2357706

Please sign in to comment.