Skip to content

Commit 62e8bdd

Browse files
committed
minor changes to function documentation and citation
1 parent ef61197 commit 62e8bdd

16 files changed

+59
-61
lines changed

NEWS.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# divraster 1.0.4
22

33
* New function added for initial testing [#3](https://github.com/flaviomoc/divraster/issues/3).
4-
* Minor corrections in function tests to align with BAT update.
4+
* Minor changes in function documentation.
5+
* Minor changes in function tests.
56
* Citation updated.
67

78
# divraster 1.0.3

R/alpha.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ spat.alpha.vec <- function(x, tree, resu, ...) {
3030
#'
3131
#' @param bin A SpatRaster with presence-absence data (0 or 1) for
3232
#' a set of species.
33-
#' @param tree It can be a data frame with species traits or a
34-
#' phylogenetic tree.
33+
#' @param tree It can be a 'data.frame' with species traits or a
34+
#' 'phylo' with a rooted phylogenetic tree. Species names in 'tree'
35+
#' and 'bin' must match!
3536
#' @param cores A positive integer. If cores > 1, a 'parallel'
3637
#' package cluster with that many cores is created and used.
3738
#' @param filename Character. Save results if a name is provided.

R/beta_spatial.R

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@ spat.beta.vec <- function(x,
7575
#'
7676
#' @description Calculates spatial beta diversity for
7777
#' taxonomic (TD), functional (FD), and phylogenetic (PD)
78-
#' dimensions. Adapted from \code{\link[BAT]{beta}}. Species
79-
#' names in 'x' and 'tree' objects must match!
78+
#' dimensions. Adapted from \code{\link[BAT]{beta}}.
8079
#'
8180
#' @param x A SpatRaster with presence-absence data (0 or 1) for a
8281
#' set of species.
83-
#' @param tree A data.frame with species traits or a phylogenetic
84-
#' tree.
82+
#' @param tree It can be a 'data.frame' with species traits or a
83+
#' 'phylo' with a rooted phylogenetic tree. Species names in 'tree'
84+
#' and 'x' must match!
8585
#' @param filename Character. Save results if a name is provided.
8686
#' @param global Logical. Mean of pairwise comparisons between
8787
#' focal cell and its neighbors (default) or mean of all pairwise
@@ -97,7 +97,6 @@ spat.beta.vec <- function(x,
9797
#' @details The TD beta diversity partitioning framework we used
9898
#' was developed by Podani and Schmera (2011) and Carvalho et al.
9999
#' (2012) and expanded to PD and FD by Cardoso et al. (2014).
100-
#' Species names in 'x' and 'tree' objects must match!.
101100
#'
102101
#' @references Cardoso, P. et al. 2014. Partitioning taxon,
103102
#' phylogenetic and functional beta diversity into replacement

R/beta_temporal.R

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,11 @@ temp.beta.vec <- function(x, nspp, spp, tree, resu, ...) {
4747
#' @param bin1 A SpatRaster with presence-absence data (0 or 1)
4848
#' for a set of species.
4949
#' @param bin2 A SpatRaster with presence-absence data (0 or 1)
50-
#' for a set of species.
51-
#' @param tree It can be a data frame with species traits or a
52-
#' phylogenetic tree.
50+
#' for a set of species. Species names in 'bin2' and 'bin1' must
51+
#' match!
52+
#' @param tree It can be a 'data.frame' with species traits or a
53+
#' 'phylo' with a rooted phylogenetic tree. Species names in 'tree',
54+
#' 'bin1', and 'bin2' must match!
5355
#' @param filename Character. Save results if a name is provided.
5456
#' @param cores A positive integer. If cores > 1, a 'parallel'
5557
#' package cluster with that many cores is created and used.

R/data.R

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
.onAttach <- function(libname, pkgname) {
2-
packageStartupMessage("Thank you for using divraster!")
3-
packageStartupMessage("To acknowledge our work, please cite the package:")
4-
packageStartupMessage(paste0("Mota, F. M. M., Alves-Ferreira, G., Talora, D. C., and Heming, N. M. (2023). divraster: an R package to calculate taxonomic, functional and phylogenetic diversity from rasters. - Ecography, e06905."))
2+
packageStartupMessage("Welcome to divraster!")
3+
packageStartupMessage("To acknowledge our work use: citation('divraster')")
54
}
65
#' Load data adapted from Mota et al. (2022), Tobias et al. (2022),
76
#' and Jetz et al. (2014)
@@ -17,8 +16,10 @@ packageStartupMessage(paste0("Mota, F. M. M., Alves-Ferreira, G., Talora, D. C.,
1716
#' Conservation of Evolutionary Distinctness in Birds. -
1817
#' Current Biology 24: 919–930.
1918
#'
20-
#' @return List with climate scenarios, traits, and phylogenetic
21-
#' tree
19+
#' @return A list with binary maps of species for the reference
20+
#' and future climate scenarios, species traits, and a rooted
21+
#' phylogenetic tree for the species. The species names across
22+
#' these objects must match!
2223
#' @export
2324
#'
2425
#' @examples

R/inputs_chk.R

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
#' @param bin1 A SpatRaster with presence-absence data (0 or 1)
44
#' for a set of species.
55
#' @param bin2 A SpatRaster with presence-absence data (0 or 1)
6-
#' for a set of species.
7-
#' @param tree It can be a data frame with species traits or a
8-
#' phylogenetic tree.
6+
#' for a set of species. Species names in 'bin2' and 'bin1' must
7+
#' match!
8+
#' @param tree It can be a 'data.frame' with species traits or a
9+
#' 'phylo' with a rooted phylogenetic tree. Species names in 'tree',
10+
#' 'bin1', and 'bin2' must match!
911
#'
10-
#' @return A message.
12+
#' @return Either a success message or an error.
1113
#' @export
1214
#'
1315
#' @examples

R/rand.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
#'
88
#' @param x SpatRaster. A SpatRaster containing presence-absence
99
#' data (0 or 1) for a set of species.
10-
#' @param tree a data.frame with species traits or a phylogenetic
11-
#' tree.
10+
#' @param tree It can be a 'data.frame' with species traits or a
11+
#' 'phylo' with a rooted phylogenetic tree. Species names in 'tree'
12+
#' and 'x' must match!
1213
#' @param aleats positive integer. A positive integer indicating
1314
#' how many times the calculation should be repeated.
1415
#' @param random character. A character indicating the type of

R/traits.R

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ spat.trait.vec <- function(x, col_trait, ...) {
1717
#' @description Compute average for each trait.
1818
#' @param x A SpatRaster with presence-absence data (0 or 1) for a
1919
#' set of species.
20-
#' @param trait A data.frame with species traits.
20+
#' @param trait A 'data.frame' with species traits. Rownames must
21+
#' have species names that match with 'x'!
2122
#' @param cores A positive integer. If cores > 1, a 'parallel'
2223
#' package cluster with that many cores is created and used.
2324
#' @param filename Character. Save results if a name is provided.

inst/CITATION

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,4 @@
1-
citHeader("Thank you for using divraster! Please cite also BAT package and the related articles in your publications:")
2-
3-
bibentry(
4-
bibtype = "Misc",
5-
title = "{divraster}: an R package to calculate taxonomic, functional and phylogenetic diversity from rasters",
6-
author = c("F. M. M. Mota", "N. M. Heming", "G. Alves-Ferreira"),
7-
year = "2023",
8-
note = "R package version 1.0.3",
9-
url = "https://CRAN.R-project.org/package=divraster"
10-
)
1+
citHeader("Thank you for using divraster! Please remember to cite BAT as well.")
112

123
bibentry(
134
bibtype = "Article",
@@ -19,15 +10,6 @@ bibentry(
1910
doi = "10.1111/ecog.06905"
2011
)
2112

22-
bibentry(
23-
bibtype = "Misc",
24-
title = "{BAT}: Biodiversity Assessment Tools",
25-
author = c("P. Cardoso", "S. Mammola", "F. Rigal", "J. Carvalho"),
26-
year = "2022",
27-
note = "R package version 2.9.2",
28-
url = "https://CRAN.R-project.org/package=BAT"
29-
)
30-
3113
bibentry(
3214
bibtype = "Article",
3315
title = "BAT -- Biodiversity Assessment Tools, an R package for the measurement and estimation of alpha and beta taxon, phylogenetic and functional diversity",

man/inputs_chk.Rd

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

man/load.data.Rd

Lines changed: 4 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: 3 additions & 2 deletions
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 & 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: 3 additions & 2 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: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/temp.beta.Rd

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

0 commit comments

Comments
 (0)