Skip to content

Commit

Permalink
Changes to passs check
Browse files Browse the repository at this point in the history
  • Loading branch information
BrunoVilela committed Aug 3, 2023
1 parent f72132f commit b915955
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion R/lets_midpoint.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#' centroid of the minimum convex polygon of the distribution, using the
#' method "MCC". This last method is useful when using a PresenceAbsence
#' object made from occurrence records.
#' @param inside logical. If TRUE the points returned are guaranteed to be
#' @param inside logical. If TRUE the points returned are guaranteed to be
#' inside the polygons or on the lines, but they are not the true centroids.
#' True centroids may be outside a polygon, for example when a polygon is
#' "bean shaped", and they are unlikely to be on their line
Expand Down
7 changes: 4 additions & 3 deletions R/summary_PresenceAbsence.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@
#' @description Summary for objects of class PresenceAbsence.
#'
#' @usage
#' \method{summary}{PresenceAbsence}(object)
#' \method{summary}{PresenceAbsence}(object, \dots)
#'
#' @param object an object of class \code{\link{PresenceAbsence}}.
#'
#' @param ... additional arguments affecting the summary produced.

#' @method summary PresenceAbsence
#' @export
#' @import terra

summary.PresenceAbsence <- function(object) {
summary.PresenceAbsence <- function(object, ...) {
object <- .check_pam(object)
class <- class(object)
Numberofspecies <- ncol(object$Pre) - 2
Expand Down
11 changes: 6 additions & 5 deletions man/lets.midpoint.Rd

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

4 changes: 3 additions & 1 deletion man/summary.PresenceAbsence.Rd

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

Binary file added tests/testthat/Rplots.pdf
Binary file not shown.
Binary file added tests/testthat/Rplots1.pdf
Binary file not shown.
6 changes: 3 additions & 3 deletions tests/testthat/test-TimLucas.r
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ test_that("Basic usage works", {
expect_equal(sum(PresAbMat[[1]][,3]), 5)
expect_equal(sum(PresAbMat[[1]][,4]), 5)

expect_true(inherits(PresAbMat[[2]], "RasterLayer"))
expect_true(inherits(PresAbMat[[2]], "SpatRaster"))

# Species list as factor not character
species <- factor(rep(c('Milvus milvus', 'Buteo buteo'), each = 5))
Expand All @@ -22,7 +22,7 @@ test_that("Basic usage works", {


# Check other projections
crsdif <- suppressWarnings(CRS("+proj=lcc +lat_1=48 +lat_2=33 +lon_0=-100 +ellps=WGS84"))
crsdif <- terra::crs("+proj=lcc +lat_1=48 +lat_2=33 +lon_0=-100 +ellps=WGS84")
PresAbMat <- lets.presab.points(xy, species, crs = crsdif)
expect_equal(class(PresAbMat), "PresenceAbsence")

Expand All @@ -49,7 +49,7 @@ test_that("Single records works", {
species <- c('Buteo buteo', 'Milvus milvus', 'Meles meles')

PresAbMat <- lets.presab.points(xy, species,
crs=CRS("+proj=longlat +datum=WGS84"))
crs=terra::crs("+proj=longlat +datum=WGS84"))
expect_equal(class(PresAbMat), "PresenceAbsence")

})
Expand Down
2 changes: 0 additions & 2 deletions tests/testthat/test-lets_rangesize.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ context("Test for lets.rangesize")

data(PAM)
data(Phyllomedusa)
Phyllomedusa <- terra::project(Phyllomedusa,
terra::crs(PAM[[2]]))

test_that("lets.rangesize works fine, geographic", {

Expand Down
Binary file added tests/testthat/testthat-problems.rds
Binary file not shown.

0 comments on commit b915955

Please sign in to comment.