From 0d770a2b9372b9a7e1f5f4a6a5f98db5d23e90d8 Mon Sep 17 00:00:00 2001 From: LuisDVA Date: Thu, 21 Nov 2024 14:28:12 -0600 Subject: [PATCH 1/3] clear up issues with wrapping for spatRaster elements in example PAM data --- R/Data_helps.R | 5 +++++ R/lets_classvar.R | 1 + man/PAM.Rd | 5 +++++ man/lets.classvar.Rd | 1 + 4 files changed, 12 insertions(+) diff --git a/R/Data_helps.R b/R/Data_helps.R index daa9828..2596448 100644 --- a/R/Data_helps.R +++ b/R/Data_helps.R @@ -22,6 +22,11 @@ #' #' PresenceAbsence object obtained using the function \code{\link{lets.presab}} #' for the Geographic distribution of the South American frog genus \link{Phyllomedusa}. +#' +#' Note that the raster element in this object is shipped as a wrapped +#' \code{SpatRaster} object and may need to be unwrapped for use in some +#' examples. +#' #' @format A PresenceAbsence object #' @source Generated from IUCN Spatial Data - \url{https://www.iucnredlist.org/}. 2014. "PAM" diff --git a/R/lets_classvar.R b/R/lets_classvar.R index fcc2bb2..ee2f0a8 100644 --- a/R/lets_classvar.R +++ b/R/lets_classvar.R @@ -26,6 +26,7 @@ #' @examples \dontrun{ #' data(PAM) #' data(temp) +#' temp <- terra::unwrap(temp) #' pamvar <- lets.addvar(PAM, temp) #' resu <- lets.classvar(x = pamvar, pos = ncol(pamvar), xy = TRUE) #' } diff --git a/man/PAM.Rd b/man/PAM.Rd index 739312b..fd3fa70 100644 --- a/man/PAM.Rd +++ b/man/PAM.Rd @@ -17,4 +17,9 @@ PAM PresenceAbsence object obtained using the function \code{\link{lets.presab}} for the Geographic distribution of the South American frog genus \link{Phyllomedusa}. } +\details{ +Note that the raster element in this object is shipped as a wrapped +\code{SpatRaster} object and may need to be unwrapped for use in some +examples. +} \keyword{datasets} diff --git a/man/lets.classvar.Rd b/man/lets.classvar.Rd index ecdc52c..1044e6c 100644 --- a/man/lets.classvar.Rd +++ b/man/lets.classvar.Rd @@ -33,6 +33,7 @@ Based on a species Presence-Absence matrix including \dontrun{ data(PAM) data(temp) +temp <- terra::unwrap(temp) pamvar <- lets.addvar(PAM, temp) resu <- lets.classvar(x = pamvar, pos = ncol(pamvar), xy = TRUE) } From 3190c5158cab7382bc1db017dbe588b859b1da01 Mon Sep 17 00:00:00 2001 From: LuisDVA Date: Thu, 21 Nov 2024 14:32:27 -0600 Subject: [PATCH 2/3] fix example of saving PAMs --- R/lets_save_load.R | 1 + man/lets.save.Rd | 1 + 2 files changed, 2 insertions(+) diff --git a/R/lets_save_load.R b/R/lets_save_load.R index a22b78c..3b27e5e 100644 --- a/R/lets_save_load.R +++ b/R/lets_save_load.R @@ -15,6 +15,7 @@ #' #' @examples \dontrun{ #' data(PAM) +#' PAM$Richness_Raster <- terra::unwrap(PAM$Richness_Raster) #' lets.save(PAM, file = "PAM.RData") #' PAM <- lets.load(file = "PAM.RData") #' } diff --git a/man/lets.save.Rd b/man/lets.save.Rd index 1ac7e51..f160725 100644 --- a/man/lets.save.Rd +++ b/man/lets.save.Rd @@ -19,6 +19,7 @@ Save an external representation of a PresenceAbsence object to \examples{ \dontrun{ data(PAM) +PAM$Richness_Raster <- terra::unwrap(PAM$Richness_Raster) lets.save(PAM, file = "PAM.RData") PAM <- lets.load(file = "PAM.RData") } From 2ffb3aa0bbc596ada8ee80a8bb3b5afcc2a526c1 Mon Sep 17 00:00:00 2001 From: LuisDVA Date: Thu, 21 Nov 2024 15:58:28 -0600 Subject: [PATCH 3/3] duplications --- DESCRIPTION | 2 +- man/iucn.Rd | 29 ------------------------ man/{lets.PAMcrop.Rd => lets.pamcrop.Rd} | 0 3 files changed, 1 insertion(+), 30 deletions(-) delete mode 100644 man/iucn.Rd rename man/{lets.PAMcrop.Rd => lets.pamcrop.Rd} (100%) diff --git a/DESCRIPTION b/DESCRIPTION index 3a92e54..102f2a8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -36,6 +36,6 @@ URL: https://besjournals.onlinelibrary.wiley.com/doi/full/10.1111/2041-210X.1240 https://github.com/macroecology/letsR, https://brunovilela.github.io/letsR/ BugReports: https://github.com/macroecology/letsR/issues -RoxygenNote: 7.3.2 +RoxygenNote: 7.3.2.9000 Encoding: UTF-8 VignetteBuilder: knitr diff --git a/man/iucn.Rd b/man/iucn.Rd deleted file mode 100644 index e9dafc8..0000000 --- a/man/iucn.Rd +++ /dev/null @@ -1,29 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/Data_helps.R -\docType{data} -\name{IUCN} -\alias{IUCN} -\title{IUCN evaluation for frogs of the genus Phyllomedusa} -\format{ -A data frame with 32 rows and 7 columns: -\describe{ - \item{Species}{Scientific name} - \item{Family}{Family} - \item{Status}{Red List Status} - \item{Criteria}{Criteria for listing as threatened} - \item{Population}{Population trend per IUCN} - \item{Description_Year}{Year described} - \item{Country}{Presence in country} -} -} -\source{ -IUCN - \url{https://www.iucnredlist.org/}. 2014. -} -\usage{ -IUCN -} -\description{ -Result of the (deprecated) function \code{\link{lets.iucn}} -applied to South American frog genus Phyllomedusa in 2014. -} -\keyword{datasets} diff --git a/man/lets.PAMcrop.Rd b/man/lets.pamcrop.Rd similarity index 100% rename from man/lets.PAMcrop.Rd rename to man/lets.pamcrop.Rd