Skip to content

Commit

Permalink
update citation (#66)
Browse files Browse the repository at this point in the history
* update citation
* rebuild site
* update urls + cran comments
  • Loading branch information
jeffreyhanson authored Feb 24, 2023
1 parent de1a21e commit d4c52e4
Show file tree
Hide file tree
Showing 27 changed files with 104 additions and 132 deletions.
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
Package: wdpar
Type: Package
Version: 1.3.3.6
Version: 1.3.4
Title: Interface to the World Database on Protected Areas
Description: Fetch and clean data from the World Database on Protected
Areas (WDPA) and the World Database on Other Effective Area-Based
Conservation Measures (WDOECM). Data is obtained from Protected Planet
<https://www.protectedplanet.net/en>. To augment data cleaning procedures,
users can install the 'prepr' R package (available at
<https://github.com/dickoa/prepr>).
<https://github.com/dickoa/prepr>). For more information on this package,
see Hanson (2022) <doi:10.21105/joss.04594>.
Authors@R: c(person(c('Jeffrey', 'O'), 'Hanson',
email='jeffrey.hanson@uqconnect.edu.au', role = c('aut', 'cre')))
Imports:
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ wbcheck:
solarischeck:
R --slave -e "rhub::check(platform = 'solaris-x86-patched', email = 'jeffrey.hanson@uqconnect.edu.au', show_status = FALSE)"

maccheck:
R --slave -e "devtools::check_mac_release()"

build:
R --slave -e "devtools::build()"
cp -R doc inst/
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
# wdpar 1.3.4

- CRAN release.
- Update citation format.

# wdpar 1.3.3.6

- Fix broken URL in vignette.
Expand Down
55 changes: 1 addition & 54 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -18,54 +18,13 @@ knitr::opts_chunk$set(fig.path = "man/figures/README-", fig.align = "center",
[![R-CMD-check-Windows](https://img.shields.io/github/actions/workflow/status/prioritizr/wdpar/R-CMD-check-windows.yaml?branch=master&label=Windows)](https://github.com/prioritizr/wdpar/actions)
[![R-CMD-check-macOS](https://img.shields.io/github/actions/workflow/status/prioritizr/wdpar/R-CMD-check-macos.yaml?branch=master&label=macOS)](https://github.com/prioritizr/wdpar/actions)
[![Documentation](https://img.shields.io/github/actions/workflow/status/prioritizr/wdpar/documentation.yaml?branch=master&label=Documentation)](https://github.com/prioritizr/wdpar/actions)
[![Coverage Status](https://img.shields.io/codecov/c/github/prioritizr/wdpar?label=Coverage)](https://codecov.io/github/prioritizr/wdpar?branch=master)
[![Coverage Status](https://img.shields.io/codecov/c/github/prioritizr/wdpar?label=Coverage)](https://app.codecov.io/gh/prioritizr/wdpar/branch/master)
[![CRAN_Status_Badge](http://www.r-pkg.org/badges/version/wdpar)](https://CRAN.R-project.org/package=wdpar)

```{r, include = FALSE}
devtools::load_all()
```

```{r, include = FALSE}
# define helpers
is_rel_version <- function(x) {
length(strsplit(as.character(x), ".", fixed = TRUE)[[1]]) == 3
}
package_version_year <- function(x) {
if (x %in% rownames(available.packages())) {
return(live_package_version_year(x))
} else {
return(archive_package_version_year(x))
}
}
live_package_version_year <- function(x) {
# fetch data
d <- versions::available.versions(x)[[1]]
d <- d[which(d$version == max(d$version)), , drop = FALSE]
c(as.character(d$version), as.character(format(as.POSIXct(d$date), "%Y")))
}
archive_package_version_year <- function(x) {
# fetch data (copied from remotes R package)
tf <- tempfile(fileext = ".gz")
on.exit(unlink(tf), add = TRUE)
download.file(tf, url = sprintf("%s/src/contrib/Meta/archive.rds", repo))
con <- gzfile(tf, "rb")
on.exit(close(con), add = TRUE)
d <- readRDS(con)[[x]]
# extract version
rel_version <- basename(rownames(d))
rel_version <- sapply(strsplit(rel_version, "_", fixed = TRUE), `[[`, 2)
rel_version <- sapply(strsplit(rel_version, ".tar", fixed = TRUE), `[[`, 1)
rel_version <- max(rel_version)
# extract year
rel_year <- as.character(max(format(d[, "mtime"], "%Y")))
# return year version
c(rel_version, rel_year)
}
```

### Overview

[Protected Planet](https://www.protectedplanet.net/en) provides the most comprehensive data for conservation areas worldwide. Specifically, it provides the World Database on Protected Areas (WDPA) and the World Database on Other Effective Area-Based Conservation Measures (WDOECM). These databases are used to monitor the performance of existing protected areas, and identify priority areas for future conservation efforts. Additionally, these databases receive monthly updates from government agencies and non-governmental organizations. However, they are associated with [several issues that need to be addressed prior to analysis](https://www.protectedplanet.net/en/resources/calculating-protected-area-coverage) and the dynamic nature of these databases means that the entire data cleaning process needs to be repeated after obtaining a new version.
Expand Down Expand Up @@ -188,18 +147,6 @@ If you need to calculate protected area coverage statistics for a country, pleas

### Citation

```{r, include = FALSE}
dev_version_year <- c(
as.character(packageDescription("wdpar")$Version),
format(Sys.time(), "%Y")
)
if (is_rel_version(dev_version_year[[1]])) {
rel_version_year <- dev_version_year
} else {
rel_version_year <- package_version_year("wdpar")
}
```

Please cite the _wdpar R_ package and the relevant databases used in publications.

To cite the package, please use:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[![R-CMD-check-macOS](https://img.shields.io/github/actions/workflow/status/prioritizr/wdpar/R-CMD-check-macos.yaml?branch=master&label=macOS)](https://github.com/prioritizr/wdpar/actions)
[![Documentation](https://img.shields.io/github/actions/workflow/status/prioritizr/wdpar/documentation.yaml?branch=master&label=Documentation)](https://github.com/prioritizr/wdpar/actions)
[![Coverage
Status](https://img.shields.io/codecov/c/github/prioritizr/wdpar?label=Coverage)](https://codecov.io/github/prioritizr/wdpar?branch=master)
Status](https://img.shields.io/codecov/c/github/prioritizr/wdpar?label=Coverage)](https://app.codecov.io/gh/prioritizr/wdpar/branch/master)
[![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/wdpar)](https://CRAN.R-project.org/package=wdpar)

### Overview
Expand Down
16 changes: 14 additions & 2 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Dear CRAN volunteers,

Thank you for reviewing this submission. The main updates in this version include (i) making data download procedures more robust, (ii) fixing compatibility issues with recent updates to GEOS (version 3.11.0), (iii) improving the documentation.
Thank you for reviewing this submission. The main updates in this version include (i) making data download and cleaning procedures more robust, (ii) improving the documentation, and (iii) updating the citation information.

Cheers,

Expand All @@ -17,7 +17,7 @@ Jeff

# R CMD check results

0 errors | 0 warnings | 2 note
0 errors | 0 warnings | 3 notes

# Package check notes

Expand All @@ -31,6 +31,18 @@ Jeff

**The prepr R package is an optional dependency that is available on GitHub (<https://github.com/dickoa/prepr>). Instructions for installing the prepr R package are provided in the DESCRIPTION file and the package README file.**

* Found the following (possibly) invalid URLs:
URL: https://doi.org/10.1111/conl.12158
FROM: README.md
Status: Service Unavailable
Message: 503
URL: https://doi.org/10.1126/science.aac9180
FROM: README.md
Status: Service Unavailable
Message: 503

**I have manually checked and can confirm that these URLs are correct.**

# Downstream dependencies

There are no existing packages that depend on this package.
2 changes: 1 addition & 1 deletion docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/CONTRIBUTING.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/LICENSE-text.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/articles/index.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions docs/articles/wdpar.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 18 additions & 12 deletions docs/authors.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d4c52e4

Please sign in to comment.