Skip to content

Commit

Permalink
Merge pull request #131 from r-spatialecology/main
Browse files Browse the repository at this point in the history
v2.2.1
  • Loading branch information
mhesselbarth authored Jan 9, 2024
2 parents 8569d8e + 82578f5 commit 66f668f
Show file tree
Hide file tree
Showing 39 changed files with 54 additions and 105 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: shar
Title: Species-Habitat Associations
Version: 2.2
Version: 2.2.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]",
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# shar 2.2.1
* Improvements
* Simplify roxygen2 docs

# shar 2.2
* Improvements
* Added a new function `reconstruct_pattern_multi()` including several internal functions and methods
Expand Down
3 changes: 0 additions & 3 deletions R/calc_gest.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
#'
#' @return data.frame
#'
#' @aliases calc_gest
#' @rdname calc_gest
#'
#' @keywords internal
calc_gest <- function(dist, r, n_points){

Expand Down
3 changes: 0 additions & 3 deletions R/calc_moments.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
#'
#' @return matrix
#'
#' @aliases calc_moments
#' @rdname calc_moments
#'
#' @keywords internal
calc_moments <- function(fn,
p,
Expand Down
3 changes: 0 additions & 3 deletions R/calculate_energy.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
#' calculate_energy(marks_recon, return_mean = FALSE)
#' }
#'
#' @aliases calculate_energy
#' @rdname calculate_energy
#'
#' @references
#' Kirkpatrick, S., Gelatt, C.D.Jr., Vecchi, M.P., 1983. Optimization by simulated
#' annealing. Science 220, 671–680. <https://doi.org/10.1126/science.220.4598.671>
Expand Down
3 changes: 0 additions & 3 deletions R/classify_habitats.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
#' landscape_classified <- classify_habitats(terra::rast(landscape), style = "fixed",
#' fixedBreaks = c(0, 0.25, 0.75, 1.0), return_breaks = TRUE)
#'
#' @aliases classify_habitats
#' @rdname classify_habitats
#'
#' @references
#' Armstrong, M.P., Xiao, N., Bennett, D.A., 2003. Using genetic algorithms to create
#' multicriteria class intervals for choropleth maps. Annals of the Association of
Expand Down
3 changes: 0 additions & 3 deletions R/classint_to_vector.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
#' classint_to_vector(x = landscape_classified$breaks, digits = 4)
#' }
#'
#' @aliases classint_to_vector
#' @rdname classint_to_vector
#'
#' @keywords internal
classint_to_vector <- function(x, digits = NULL) {

Expand Down
3 changes: 0 additions & 3 deletions R/compute_statistics.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
#'
#' @return list
#'
#' @aliases compute_statistics
#' @rdname compute_statistics
#'
#' @keywords internal
compute_statistics <- function(x, y, k, xr, yr, w_statistics, bw, divisor, kernel_arg, r) {

Expand Down
3 changes: 0 additions & 3 deletions R/create_neighbourhood.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
#' create_neighbourhood(cell_id, mat)
#' }
#'
#' @aliases create_neighbourhood
#' @rdname create_neighbourhood
#'
#' @keywords internal
create_neighbourhood <- function(cells, matrix, directions = 4) {

Expand Down
3 changes: 0 additions & 3 deletions R/dummy_transf.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
#'
#' @return matrix
#'
#' @aliases dummy_transf
#' @rdname dummy_transf
#'
#' @keywords internal
to_dummy <- function(f) {
x <- matrix(0, length(f), nlevels(f), dimnames=list(names(f), levels(f)))
Expand Down
3 changes: 0 additions & 3 deletions R/energy_fun.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
#'
#' @return vector
#'
#' @aliases energy_fun
#' @rdname energy_fun
#'
#' @keywords internal
#'
Energy_fun <- function(f, f0, statistics, f_, f0_, statistics_, fn, p, p_, Lp, w_statistics) {
Expand Down
3 changes: 0 additions & 3 deletions R/extract_points.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
#' extract_points(raster = landscape_classified, pattern = species_b)
#' }
#'
#' @aliases extract_points
#' @rdname extract_points
#'
#' @keywords internal
extract_points <- function(raster, pattern){

Expand Down
3 changes: 0 additions & 3 deletions R/fit_point_process.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
#' @examples
#' pattern_fitted <- fit_point_process(pattern = species_a, n_random = 39)
#'
#' @aliases fit_point_process
#' @rdname fit_point_process
#'
#' @references
#' Plotkin, J.B., Potts, M.D., Leslie, N., Manokaran, N., LaFrankie, J.V.,
#' Ashton, P.S., 2000. Species-area curves, spatial aggregation, and habitat specialization
Expand Down
3 changes: 0 additions & 3 deletions R/get_dist_pairs.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@
#'
#' @return matrix
#'
#' @aliases get_dist_pairs
#' @rdname get_dist_pairs
#'
#' @keywords internal
get_dist_pairs <- function(X, rmax){

Expand Down
3 changes: 0 additions & 3 deletions R/list_to_randomized.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
#' list_to_randomized(list = fit_list, observed = species_a)
#' }
#'
#' @aliases list_to_randomized
#' @rdname list_to_randomized
#'
#' @export
list_to_randomized <- function(list, observed = NULL) {

Expand Down
3 changes: 0 additions & 3 deletions R/pack_randomized.R
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
#' x <- pack_randomized(raster = landscape_random)
#' }
#'
#' @aliases pack_randomized
#' @rdname pack_randomized
#'
#' @export
pack_randomized <- function(raster) {

Expand Down
4 changes: 0 additions & 4 deletions R/plot.rd_mar.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@
#' plot(marks_recon)
#' }
#'
#'
#' @aliases plot.rd_mar
#' @rdname plot.rd_mar
#'
#' @export
plot.rd_mar <- function(x, what = "sf", n = NULL, probs = c(0.025, 0.975),
ask = TRUE, verbose = TRUE, ...) {
Expand Down
3 changes: 0 additions & 3 deletions R/plot.rd_multi.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
#'
#' @return void
#'
#' @aliases plot.rd_multi
#' @rdname plot.rd_multi
#'
#' @export
plot.rd_multi <- function(x, verbose = TRUE, ...) {

Expand Down
3 changes: 0 additions & 3 deletions R/plot.rd_pat.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@
#' plot(pattern_recon)
#' }
#'
#' @aliases plot.rd_pat
#' @rdname plot.rd_pat
#'
#' @export
plot.rd_pat <- function(x, what = "sf", n = NULL, probs = c(0.025, 0.975),
ask = TRUE, verbose = TRUE, ...) {
Expand Down
3 changes: 0 additions & 3 deletions R/plot.rd_ras.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@
#' plot(landscape_random)
#' }
#'
#' @aliases plot.rd_ras
#' @rdname plot.rd_ras
#'
#' @export
plot.rd_ras <- function(x, n = NULL, col, verbose = TRUE, nrow, ncol, ...) {

Expand Down
3 changes: 0 additions & 3 deletions R/plot_energy.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@
#' plot_energy(marks_recon)
#' }
#'
#' @aliases plot_energy
#' @rdname plot_energy
#'
#' @export
plot_energy <- function(pattern,
col = NULL){
Expand Down
3 changes: 0 additions & 3 deletions R/print.rd_mar.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
#' print(marks_recon)
#' }
#'
#' @aliases print.rd_mar
#' @rdname print.rd_mar
#'
#' @export
print.rd_mar <- function(x, digits = 4, ...) {

Expand Down
3 changes: 0 additions & 3 deletions R/print.rd_pat.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
#' print(pattern_recon)
#' }
#'
#' @aliases print.rd_pat
#' @rdname print.rd_pat
#'
#' @export
print.rd_pat <- function(x,
digits = 4,
Expand Down
3 changes: 0 additions & 3 deletions R/print.rd_ras.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
#' print(landscape_random)
#' }
#'
#' @aliases print.rd_ras
#' @rdname print.rd_ras
#'
#' @export
print.rd_ras <- function(x, ...) {

Expand Down
3 changes: 0 additions & 3 deletions R/randomize_raster.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
#' landscape_random <- randomize_raster(landscape_classified, n_random = 19)
#' }
#'
#' @aliases randomize_raster
#' @rdname randomize_raster
#'
#' @references
#' Harms, K.E., Condit, R., Hubbell, S.P., Foster, R.B., 2001. Habitat associations of
#' trees and shrubs in a 50-ha neotropical forest plot. Journal of Ecology 89, 947–959.
Expand Down
3 changes: 0 additions & 3 deletions R/reconstruct_algorithm.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
#'
#' @return list
#'
#' @aliases reconstruct_algorithm
#' @rdname reconstruct_algorithm
#'
#' @keywords internal
reconstruct_algorithm <- function(pattern,
method,
Expand Down
3 changes: 0 additions & 3 deletions R/reconstruct_pattern.R
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@
#' pattern_recon <- reconstruct_pattern(species_b, n_random = 19, max_runs = 1000)
#' }
#'
#' @aliases reconstruct_pattern
#' @rdname reconstruct_pattern
#'
#' @references
#' Kirkpatrick, S., Gelatt, C.D.Jr., Vecchi, M.P., 1983. Optimization by simulated
#' annealing. Science 220, 671–680. <https://doi.org/10.1126/science.220.4598.671>
Expand Down
3 changes: 0 additions & 3 deletions R/reconstruct_pattern_marks.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@
#' n_random = 19, max_runs = 1000)
#' }
#'
#' @aliases reconstruct_pattern_marks
#' @rdname reconstruct_pattern_marks
#'
#' @references
#' Kirkpatrick, S., Gelatt, C.D.Jr., Vecchi, M.P., 1983. Optimization by simulated
#' annealing. Science 220, 671–680. <https://doi.org/10.1126/science.220.4598.671>
Expand Down
3 changes: 0 additions & 3 deletions R/reconstruct_pattern_multi.R
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@
#' max_steps = 10000)
#' }
#'
#' @aliases reconstruct_pattern_multi
#' @rdname reconstruct_pattern_multi
#'
#' @references
#' Kirkpatrick, S., Gelatt, C.D.Jr., Vecchi, M.P., 1983. Optimization by simulated
#' annealing. Science 220, 671–680. <https://doi.org/10.1126/science.220.4598.671>
Expand Down
3 changes: 0 additions & 3 deletions R/results_habitat_association.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@
#' species_a_random <- fit_point_process(species_a, n_random = 199)
#' results_habitat_association(pattern = species_a_random, raster = landscape_classified)
#'
#' @aliases results_habitat_association
#' @rdname results_habitat_association
#'
#' @references
#' Harms, K.E., Condit, R., Hubbell, S.P., Foster, R.B., 2001. Habitat associations of
#' trees and shrubs in a 50-ha neotropical forest plot. Journal of Ecology 89, 947–959.
Expand Down
3 changes: 0 additions & 3 deletions R/sample_randomized.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@
#' sample_randomized(randomized = reconstruction$randomized, n = c(5, 10, 15))
#' }
#'
#' @aliases sample_randomized
#' @rdname sample_randomized
#'
#' @keywords internal
sample_randomized <- function(randomized, n = NULL, verbose = TRUE) {

Expand Down
3 changes: 0 additions & 3 deletions R/select_kernel.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,6 @@
#'
#' @return list
#'
#' @aliases select_kernel
#' @rdname select_kernel
#'
#' @keywords internal
#'
select_kernel <- function(kernel_arg, bw, rmax, divisor) {
Expand Down
3 changes: 0 additions & 3 deletions R/translate_raster.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
#' steps_x = 1:10, steps_y = 1:5)
#' }
#'
#' @aliases translate_raster
#' @rdname translate_raster
#'
#' @references
#' Harms, K.E., Condit, R., Hubbell, S.P., Foster, R.B., 2001. Habitat associations
#' of trees and shrubs in a 50-ha neotropical forest plot. Journal of Ecology 89, 947–959.
Expand Down
3 changes: 0 additions & 3 deletions R/unpack_randomized.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
#' y <- unpack_randomized(raster = y)
#' }
#'
#' @aliases unpack_randomized
#' @rdname unpack_randomized
#'
#' @export
unpack_randomized <- function(raster) {

Expand Down
Loading

0 comments on commit 66f668f

Please sign in to comment.