Skip to content

Commit 1a531c3

Browse files
committed
minor changes to description and examples
1 parent 988d107 commit 1a531c3

16 files changed

+53
-63
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Authors@R: c(
1010
comment = c(ORCID = "0000-0001-5661-3381"))
1111
)
1212
Maintainer: Flávio M. M. Mota <flaviomoc@gmail.com>
13-
Description: The divraster package calculates diversity patterns (alpha and beta) from raster data for taxonomic (TD), functional (FD), and phylogenetic (PD) dimensions. Spatial and temporal beta diversity can be partitioned into replacement and richness difference components. It also calculates standardized effect size for FD and PD alpha diversity and the average individual traits across multilayer rasters. The raster's layers represent species, while the cells represent communities.
13+
Description: Alpha and beta diversity for taxonomic (TD), functional (FD), and phylogenetic (PD) dimensions based on rasters. Spatial and temporal beta diversity can be partitioned into replacement and richness difference components. It also calculates standardized effect size for FD and PD alpha diversity and the average individual traits across multilayer rasters. The layers of the raster represent species, while the cells represent communities. Methods details can be found at Cardoso et al. 2022 <https://CRAN.R-project.org/package=BAT> and Heming et al. 2023 <https://CRAN.R-project.org/package=SESraster>.
1414
License: GPL (>= 3)
1515
URL: https://github.com/flaviomoc/divraster
1616
BugReports: https://github.com/flaviomoc/divraster/issues

R/alpha.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ spat.alpha.vec <- function(x, tree, resu, ...) {
3939
#' @export
4040
#'
4141
#' @examples
42-
#' \dontrun{
42+
#' \donttest{
4343
#' library(terra)
4444
#' bin1 <- terra::rast(system.file("extdata", "ref.tif",
4545
#' package = "divraster"))

R/beta_spatial.R

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
#' Spatial beta diversity for vector
22
#'
3-
#' This function will compute beta diversity on vectors containing
4-
#' multiple species at multiple sites. Species at sites should be
5-
#' placed sequentially, so that the vector can be transformed in a
6-
#' matrix with species at columns and sites at rows.
7-
#'
83
#' @param x A numeric vector with presence-absence data (0 or 1)
94
#' for a set of species.
105
#' @param tree It can be a data frame with species traits or a
@@ -17,7 +12,8 @@
1712
#' @param ... Additional arguments to be passed passed down from a
1813
#' calling function.
1914
#'
20-
#' @return A SpatRaster with beta results.
15+
#' @return A SpatRaster with beta results (total, replacement,
16+
#' and richness differences).
2117
spat.beta.vec <- function(x, tree, global = FALSE, spp, nspp, ...) {
2218
x <- matrix(x, ncol = nspp, byrow = FALSE,
2319
dimnames = list(NULL, spp))
@@ -47,10 +43,6 @@ spat.beta.vec <- function(x, tree, global = FALSE, spp, nspp, ...) {
4743

4844
#' Spatial beta diversity for raster
4945
#'
50-
#' This function will compute beta diversity on spatRast objects
51-
#' that contain binary (presence/absence) species distribution data.
52-
#' @description Compute alpha diversity for taxonomic, functional,
53-
#' and phylogenetic diversity.
5446
#' @param x A SpatRaster with presence-absence data (0 or 1) for a
5547
#' set of species.
5648
#' @param tree A data.frame with species traits or a phylogenetic
@@ -67,11 +59,12 @@ spat.beta.vec <- function(x, tree, global = FALSE, spp, nspp, ...) {
6759
#' @param ... Additional arguments to be passed passed down from
6860
#' a calling function.
6961
#'
70-
#' @return A SpatRaster with beta results.
62+
#' @return A SpatRaster with beta results (total, replacement,
63+
#' and richness differences).
7164
#' @export
7265
#'
7366
#' @examples
74-
#' \dontrun{
67+
#' \donttest{
7568
#' library(terra)
7669
#' bin1 <- terra::rast(system.file("extdata", "ref.tif",
7770
#' package = "divraster"))

R/beta_temporal.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@
1010
#' @param ... Additional arguments to be passed passed down from
1111
#' a calling function.
1212
#'
13-
#' @return A SpatRaster with beta results.
13+
#' @return A SpatRaster with beta results (total, replacement,
14+
#' and richness differences).
1415
temp.beta.vec <- function(x, nspp, spp, tree, resu, ...) {
1516
if (all(is.na(x))) {
1617
resu[] <- NA
@@ -39,11 +40,11 @@ temp.beta.vec <- function(x, nspp, spp, tree, resu, ...) {
3940
#' @param ... Additional arguments to be passed passed down from
4041
#' a calling function.
4142
#'
42-
#' @return A SpatRaster with beta results.
43+
#' @return A SpatRaster with beta results (total, replacement,
44+
#' and richness differences).
4345
#' @export
4446
#'
4547
#' @examples
46-
#' \dontrun{
4748
#' library(terra)
4849
#' bin1 <- terra::rast(system.file("extdata", "ref.tif",
4950
#' package = "divraster"))
@@ -56,7 +57,6 @@ temp.beta.vec <- function(x, nspp, spp, tree, resu, ...) {
5657
#' temp.beta(bin1, bin2)
5758
#' temp.beta(bin1, bin2, traits)
5859
#' temp.beta(bin1, bin2, tree)
59-
#' }
6060
temp.beta <- function(bin1, bin2, tree, filename = NULL,
6161
cores = 1, ...) {
6262
# Check if rasters are NULL or invalid

R/data.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@
1717
#' @export
1818
#'
1919
#' @examples
20-
#' \dontrun{
2120
#' data <- load.data()
2221
#' data
23-
#' }
2422
load.data <- function() {
2523
ref <- terra::rast(system.file("extdata",
2624
"ref_frugivor.tif",

R/rand.R

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,38 @@
22
#' diversity
33
#'
44
#' @description Calculates the standardized effect size for
5-
#' functional and phylogenetic diversity. See SESraster package for details.
6-
#'
5+
#' functional and phylogenetic diversity.
6+
#' See \code{\link[SESraster]{bootspat_str}} and
7+
#' \code{\link[SESraster]{bootspat_naive}}
8+
9+
710
#' @param x SpatRaster. A SpatRaster containing presence-absence
811
#' data (0 or 1) for a set of species.
912
#' @param tree a data.frame with species traits or a phylogenetic
1013
#' tree.
1114
#' @param aleats positive integer. A positive integer indicating
1215
#' how many times the calculation should be repeated.
1316
#' @param random character. A character indicating the type of
14-
#' randomization. The currently available randomization methods are "spat",
15-
#' "site", "species" or "both" (site and species).
17+
#' randomization. The currently available randomization methods
18+
#' are "spat", "site", "species" or "both" (site and species).
1619
#' @param cores positive integer. If cores > 1, a 'parallel'
1720
#' package cluster with that many cores is created and used.
1821
#' @param filename character. Output filename.
19-
#' @param ... additional arguments to be passed passed down from a
20-
#' calling function.
22+
#' @param ... additional arguments to be passed passed down from
23+
#' a calling function.
2124
#'
2225
#' @return SpatRaster with Mean, SD, Observed, and SES.
2326
#' @export
2427
#'
2528
#' @examples
26-
#' \dontrun{
2729
#' x <- terra::rast(system.file("extdata", "ref.tif",
2830
#' package = "divraster"))
2931
#' traits <- read.csv(system.file("extdata", "traits.csv",
3032
#' package = "divraster"), row.names = 1)
3133
#' tree <- ape::read.tree(system.file("extdata", "tree.tre",
3234
#' package = "divraster"))
33-
#' spat.rand(x, traits, 10, "spat")
34-
#' spat.rand(x, tree, 10, "spat")
35-
#' }
35+
#' spat.rand(x, tree, 3, "site")
36+
#' spat.rand(x, traits, 3, "site")
3637
spat.rand <- function(x,
3738
tree,
3839
aleats,

R/traits.R

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,12 @@ spat.trait.vec <- function(x, col_trait, ...) {
2828
#' @export
2929
#'
3030
#' @examples
31-
#' \dontrun{
3231
#' library(terra)
3332
#' bin1 <- terra::rast(system.file("extdata", "ref.tif",
3433
#' package = "divraster"))
3534
#' traits <- read.csv(system.file("extdata", "traits.csv",
3635
#' package = "divraster"), row.names = 1)
3736
#' spat.trait(bin1, traits)
38-
#' }
3937
spat.trait <- function(x,
4038
trait,
4139
cores = 1,

cran-comments.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,13 @@
33
0 errors | 0 warnings | 1 note
44

55
* This is a new release.
6+
7+
## Maintainer comments
8+
9+
* The description was updated, and now it no longer starts with "This package", the package name, title, or anything similar.
10+
11+
* Package names, software names, and API without single quotes in titles and descriptions were checked.
12+
13+
* References describing the methods have been added to the description file: Cardoso et al. 2022 <https://CRAN.R-project.org/package=BAT> and Heming et al. 2023 <https://CRAN.R-project.org/package=SESraster>
14+
15+
* \dontrun{} was either removed or replaced with \donttest{}

man/load.data.Rd

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/spat.alpha.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/spat.beta.Rd

Lines changed: 4 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/spat.beta.vec.Rd

Lines changed: 3 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/spat.rand.Rd

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/spat.trait.Rd

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/temp.beta.Rd

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/temp.beta.vec.Rd

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)