diff --git a/man/FitGAM.Rd b/man/FitGAM.Rd index abc56c7..e3da3d8 100644 --- a/man/FitGAM.Rd +++ b/man/FitGAM.Rd @@ -41,3 +41,13 @@ Fit a GAM that predicts abundance based on the data. One should supply a formul \details{ If verbose=T, printouts of the model selection process are produced. } +\examples{ +gam.form <- formula("a_atf ~ s(lon,lat,bs = 'ds',m=c(1,.5), k=10) + +s(bdepth, bs='tp',m=1,k=4) + s(btemp, bs='tp',m=1,k=4) + +s(slope, bs='tp',m=1,k=4) + offset(logarea)") +data("region_data_all") +region_data_all$sponge <- as.integer(region_data_all$sponge > 0) +region_data_all$logarea <- log(region_data_all$area) + +poisson.model <- FitGAM(gam.formula = gam.form, data = region_data_all, family.gam = "poisson") +} diff --git a/man/GAMStats.Rd b/man/GAMStats.Rd index bfc0cc3..5ce1914 100644 --- a/man/GAMStats.Rd +++ b/man/GAMStats.Rd @@ -12,7 +12,7 @@ GAMStats(model, data) \item{data}{a data frame; usually the same one used to fit the GAM model} } \value{ -a named vector of decimal values indicating the percent contribution +a named vector of decimal values indicating the percent contribution to deviance explained } \description{ Make a quick and dirty jackknife estimate of the deviance explained by each variable diff --git a/man/GOA_bathy.Rd b/man/GOA_bathy.Rd index 044e9f3..b340f9a 100644 --- a/man/GOA_bathy.Rd +++ b/man/GOA_bathy.Rd @@ -9,7 +9,6 @@ A raster layer with 12 slots \describe{ \item{name}{character string with path to raster layer} \item{datanotation}{Raster file native format} -... } } \source{ diff --git a/man/MakeAKGFDotplot.Rd b/man/MakeAKGFDotplot.Rd index 8695f57..c8e7e8a 100644 --- a/man/MakeAKGFDotplot.Rd +++ b/man/MakeAKGFDotplot.Rd @@ -86,3 +86,23 @@ makes a pretty good dotplot; needs additional testing with areas other than "bs. \details{ Settings are set to work with 8x8 in 300 res output, so results may vary when making different size figures. } +\examples{ +data("region_data_all") +region.data <- region_data_all +region.data$sponge <- as.integer(region.data$sponge > 0) +region.data$coral <- as.integer(region.data$coral > 0) +region.data$pen <- as.integer(region.data$pen > 0) +region.data$logarea <- log(region.data$area) +data("raster_stack") +raster.stack <- terra::rast(raster_stack) +species.data <- subset(region.data, year >= 2012) +species <- "a_atf" +hd <- stats::quantile(species.data[species.data[, species] > 0, species], .9) +MakeAKGFDotplot( + presence = species.data[species.data[, species] > 0, ], + absence = species.data[species.data[, species] == 0, ], + highdensity = species.data[species.data[, species] >= hd, ], + dataCRS = terra::crs(raster.stack), region = "goa", + title.name = "Adult arrowtooth flounder" +) +} diff --git a/man/raster_stack.Rd b/man/raster_stack.Rd new file mode 100644 index 0000000..bfc85f0 --- /dev/null +++ b/man/raster_stack.Rd @@ -0,0 +1,27 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/data.R +\docType{data} +\name{raster_stack} +\alias{raster_stack} +\title{GOA covariate data} +\format{ +A terra PackedSpatRaster with 6 slots +\describe{ +\item{lon}{Longitude} +\item{lat}{Latitude} +\item{bdepth}{Bottom depth in meters} +\item{btemp}{slope}{The rate of change in bathymetry over a defined area, measured as the first derivative of the bathymetric surface, in degrees of incline (Horn 1981, Dolan and Lucieer 2014.)} +\item{sponge}{CPUE of sponge from bottom trawl surveys. Usually, this is transformed into sponge presence-absence when fitting EFH SDMs.} +} +} +\source{ +Compiled by Jeremy Harris using 1-km resolution data from Mark Zimmerman +} +\usage{ +data(raster_stack) +} +\description{ +A terra SpatRaster containing environmental covariates for the GOA, +as used in the 2023 EFH review. +} +\keyword{datasets} diff --git a/man/region_data_all.Rd b/man/region_data_all.Rd index 8618672..3b67b69 100644 --- a/man/region_data_all.Rd +++ b/man/region_data_all.Rd @@ -3,9 +3,17 @@ \docType{data} \name{region_data_all} \alias{region_data_all} -\title{Region data for abundance for all the EFH species included in the 2022 Review} +\title{GOA region data for abundance for EFH species and lifestages included in the 2023 Review} \format{ -A data frame with 15592 rows and 184 variables +a data frame with 8,507 rows and 184 variables (each species/lifestage gets a column): +\describe{ +\item{hauljoin} +\item{region}{EFH area (EBS, GOA, or AI)} +\item{subregion}{Subregion.} +\item{vessel}{Vessel ID from the survey; matches RACEBASE, FOSS, others} +\item{cruise}{Cruise ID number} +\item{haul}{Haul number} +} } \usage{ data(region_data_all) @@ -13,15 +21,4 @@ data(region_data_all) \description{ The variables are as follows: } -\details{ -\itemize{ -\item hauljoin. -\item region. EFH area (EBS, GOA, or AI) -\item subregion. -\item vessel. Vessel ID from the survey; matches RACEBASE, FOSS, others -\item cruise. Cruise ID number. -\item haul. Haul number. -... -} -} \keyword{datasets}