Skip to content

Commit

Permalink
change in the description of functions
Browse files Browse the repository at this point in the history
correction of spelling errors
  • Loading branch information
gabferreira committed Mar 19, 2024
1 parent 196d4f7 commit d130e25
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 40 deletions.
5 changes: 3 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

# phyloraster 2.1.0

- added functions to compute full and tip branch lengths: 'species.tip.length()' and 'species.branch.length()'
- added new function to compute ED for each species
- added functions to compute full and tip branch lengths: 'species.tip.length()' and 'species.branch.length()'
- added new function to compute ED for each species: 'species.ed()'
- fixed ED calculation for raster data
- added new tests for the new functions

# phyloraster 2.0.1

Expand Down
14 changes: 6 additions & 8 deletions R/delta.grid.R
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
.delta.vec <- function(x) {
diff <- x[2] - x[1] # diference between metric in time 2 and 1
diff <- x[2] - x[1] # difference between metric in time 2 and 1
}

#' Calculates the delta of spatialized diversity metrics (richness,
#' phylogenetic endemism, phylogenetic diversity, weighted endemism,
#' evolutionary distinctiveness) between different time periods
#' Delta of Diversity Metrics
#'
#' @description Calculates the delta of spatialized diversity metrics
#' @description Calculates the difference of rasterized diversity metrics
#' (richness, phylogenetic endemism, phylogenetic diversity, weighted endemism,
#' evolutionary distinctiveness) between different time periods.
#' @param r1 SpatRaster Spatialized diversity metrics for time 1 (e.g
#' evolutionary distinctiveness) between time periods.
#' @param r1 SpatRaster Rasterized diversity metrics for time 1 (e.g
#' phylogenetic diversity in present). To calculate some diversity metrics for
#' rasters see phyloraster::geo.phylo function.
#' @param r2 SpatRaster Spatialized diversity metrics for time 2 (e.g
#' @param r2 SpatRaster Rasterized diversity metrics for time 2 (e.g
#' phylogenetic diversity in future).
#' @param filename character. Output filename.
#' @param ... additional arguments to be passed passed down from a calling
Expand Down
4 changes: 1 addition & 3 deletions R/df2rast.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@
#' @param ... additional arguments to be passed passed down from a calling
#' function.
#' @param CRS character. Description of the Coordinate Reference System
#' (map projection) in PROJ.4, WKT or authority:code notation. See crs. If
#' this argument is missing, and the x coordinates are within -360 .. 360 and
#' the y coordinates are within -90 .. 90, longitude/latitude is assigned
#' (map projection) in PROJ.4.
#' @return SpatRaster
#' @export
#' @examples
Expand Down
10 changes: 5 additions & 5 deletions R/geo.phylo.R
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ rast.sr <- function(x, filename = "", ...){
#' @references Williams, P.H., Humphries, C.J., Forey, P.L., Humphries, C.J. and
#' VaneWright, R.I. (1994). Biodiversity, taxonomic relatedness, and endemism in
#' conservation. In: Systematics and Conservation Evaluation (eds Forey PL,
#' Humphries CJ, Vane-Wright RI), p. 438. Oxford University Press, Oxford.
#' Humphries C.J., Vane-Wright RI), p. 438. Oxford University Press, Oxford.
#' @references Crisp, M., Laffan, S., Linder, H. and Monro, A. (2001). Endemism
#' in theAustralian flora. Journal of Biogeography, 28, 183–198.
#' in the Australian flora. Journal of Biogeography, 28, 183–198.
#' @references Isaac, N. J., Turvey, S. T., Collen, B., Waterman, C. and
#' Baillie, J. E. (2007). Mammals on the EDGE: conservation priorities based on
#' threat and phylogeny. PLoS ONE 2, e296.
Expand Down Expand Up @@ -196,10 +196,10 @@ rast.sr <- function(x, filename = "", ...){
#' @references Williams, P.H., Humphries, C.J., Forey, P.L., Humphries, C.J.
#' and VaneWright, R.I. (1994). Biodiversity, taxonomic relatedness, and
#' endemism in conservation. In: Systematics and Conservation Evaluation
#' (eds Forey PL, Humphries CJ, Vane-Wright RI), p. 438. Oxford University
#' (eds Forey PL, Humphries C.J., Vane-Wright RI), p. 438. Oxford University
#' Press, Oxford.
#' @references Crisp, M., Laffan, S., Linder, H. and Monro, A. (2001).
#' Endemism in theAustralian flora. Journal of Biogeography, 28, 183–198.
#' Endemism in the Australian flora. Journal of Biogeography, 28, 183–198.
#' @references Isaac, N. J., Turvey, S. T., Collen, B., Waterman, C. and
#' Baillie, J. E. (2007). Mammals on the EDGE: conservation priorities based on
#' threat and phylogeny. PLoS ONE 2, e296.
Expand Down Expand Up @@ -323,7 +323,7 @@ geo.phylo <- function(x, tree,
#' @references Williams, P.H., Humphries, C.J., Forey, P.L., Humphries, C.J.,
#' VaneWright, R.I. (1994). Biodiversity, taxonomic relatedness, and endemism
#' in conservation. In: Systematics and Conservation Evaluation (eds Forey PL,
#' Humphries CJ, Vane-Wright RI), p. 438. Oxford University Press, Oxford.
#' Humphries C.J., Vane-Wright RI), p. 438. Oxford University Press, Oxford.
#' @references Crisp, M., Laffan, S., Linder, H., Monro, A. (2001). Endemism
#' in the Australian flora. Journal of Biogeography, 28, 183–198.
#'
Expand Down
8 changes: 6 additions & 2 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@

* This is a new release.

* \dontrun{} has been replaced with \donttest{}.
* added functions to compute full and tip branch lengths: 'species.tip.length()' and 'species.branch.length()'

* Comments in the example code lines have been removed.
* added new function to compute ED for each species: 'species.ed()'

* fixed ED calculation for raster data

* added new tests for the new functions

12 changes: 5 additions & 7 deletions man/delta.grid.Rd

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

4 changes: 1 addition & 3 deletions man/df2rast.Rd

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

4 changes: 2 additions & 2 deletions man/dot-rast.geo.phylo.Rd

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

4 changes: 2 additions & 2 deletions man/geo.phylo.Rd

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

2 changes: 1 addition & 1 deletion man/geo.phylo.ses.Rd

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

4 changes: 2 additions & 2 deletions tests/testthat/test-geo.phylo.R
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ test_that("names are reordened in the function geo.phylo", {

# tests
expect(geo.phylo(data$x, tree, #range.BL = area.branch$range.BL,
inv.R = inv.R,
edge.path = data$edge.path[sample(1:nrow(data$edge.path)),],
inv.R = inv.R,
edge.path = data$edge.path[sample(1:nrow(data$edge.path)),],
branch.length = data$branch.length,
n.descen = data$n.descendants), ok = T)

Expand Down
6 changes: 3 additions & 3 deletions vignettes/phyloraster-vignette.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ library(phylobase)

## Data processing {#data}

In the step of pre processing, we offer support to manipulate matrices,
In the step of pre-processing, we offer support to manipulate matrices,
shapefiles, rasters, and phylogenetic trees.
In the processing step, we provide functions to calculate Faith's phylogenetic
diversity (Faith, 1992), phylogenetic endemism (Rosauer et al., 2009),
Expand Down Expand Up @@ -410,7 +410,7 @@ plot(t)
- **Function** `delta.grid`

The package also brings the function `delta.grid` that allows you to calculate
the difference between spatialized diversity metrics between two different times.
the difference between rasterized diversity metrics between two different times.
This function would allow assessing how species richness varies between
different times, which could be useful in a climate change scenario.
For example, imagine that we currently have 33 tree frog species of the
Expand Down Expand Up @@ -474,7 +474,7 @@ Gotelli, N. J., and McCabe, D. J.
Species co-occurrence: A meta-analysis of J.
M. Diamond's assembly rules model.
Ecology, 83(8), 2091--2096.
[https://doi.org/10.1890/0012-9658(2002)083[2091:SCOAMA]2.0.CO;2](https://doi.org/10.1890/0012-9658(2002)083%5B2091:SCOAMA%5D2.0.CO;2){.uri}
<https://doi.org/10.1890/0012-9658(2002)083%5B2091:SCOAMA%5D2.0.CO;2>

Gotelli, N. J., and Ulrich, W.
(2012).
Expand Down

0 comments on commit d130e25

Please sign in to comment.