Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: RstoxBase
Version: 2.2.0-9009
Date: 2026-01-12
Date: 2026-01-24
Title: Base StoX Functions
Authors@R: c(
person(given = "Arne Johannes",
Expand Down Expand Up @@ -47,7 +47,7 @@ Imports:
jsonlite (>= 1.6),
lwgeom (>= 0.2-0),
maps (>= 0.2-0),
RstoxData (>= 2.2.0-9010),
RstoxData (>= 2.2.0-9011),
sf (>= 0.9.0),
stringi (>= 1.4.0),
units (>= 0.7),
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export(RelativeLengthDistribution)
export(ReportDensity)
export(ReportQuantity)
export(ReportSpeciesCategoryCatch)
export(ReportStationsAlongTransectDesign)
export(ReportSuperIndividuals)
export(ReportTransectDesign)
export(SpeciesCategoryCatch)
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# RstoxBase v2.2.0-9009 (2026-01-12)
* Added the new function ReportStationsAlongTransectDesign().
* Fixed bug in PlotTransectDesign() where TrackPointColor did not work.
* Re-organized arguments of TransectDesign() to have SurveyDistance before SurveyTime, since SurveyDistance has precedence over SurveyTime.
* Fixed bug in the drop down list of DensityUnit in ReportDensity(), where only the area number density units were shown even when DensityType was "AreaWeightDensity" (by introducing the column variableType in dataTypeUnits).
* Fixed bug where ReplaceLevel and ReplaceStratumLayerIndividual were not reset in ImputeSuperIndividuals, so that values from a previous such process remained in the output.
* Removed the argument EqualEffort from TransectDesign(), as this is better accomplished using a common Coverage for all Strata.
* Fixed bug where Coverage was not calculated.

# RstoxBase v2.2.0-9008 (2025-11-12)
* Added names to stations in output from WriteStationsAlongTransectDesign() in the form Station_01, Station_02, etc.
Expand Down
15 changes: 14 additions & 1 deletion R/Data.R
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ NULL
#' General stratum plotting parameters of RstoxBase
#'
#' @param ShowStratumPolygon Logical: If TRUE include the stratumPolygon. in the plot.
#' @param StratumPolygonColor Character: The color palette to use for the strata. The default ("hue") is the default HUE color used by ggplot2. See the \code{Palettes} section in \code{\link[ggplot2]{scale_fill_brewer}} for a list of options (both Diverging, Qualitative and Sequential color palettes are possible).
#' @param StratumPolygonColor Character: The color palette to use for the strata. The default ("hue") is the default HUE color used by ggplot2. See the \code{Palettes} section in \code{\link[ggplot2]{scale_fill_brewer}} for a list of options (both Diverging, Qualitative and Sequential color palettes are possible). A color blind firendly palette is "viridis".
#' @param StratumPolygonBorderColor Character: The single color to use for the polygon borders.
#' @param StratumPolygonBorderLineWidth Numeric: The line width of the polygon borders.
#'
Expand Down Expand Up @@ -265,6 +265,7 @@ NULL
#' @param WriteTransectDesignData The \code{\link{WriteTransectDesignData}} data.
#' @param PlotTransectDesignData The \code{\link{PlotTransectDesignData}} data.
#' @param StationsAlongTransectDesignData The \code{\link{StationsAlongTransectDesignData}} data.
#' @param ReportStationsAlongTransectDesignData The \code{\link{ReportStationsAlongTransectDesignData}} data.
#' @param WriteStationsAlongTransectDesignData The \code{\link{WriteStationsAlongTransectDesignData}} data.
#' @param NASCData The \code{\link{NASCData}} data.
#' @param SumNASCData The \code{\link{SumNASCData}} data.
Expand Down Expand Up @@ -635,6 +636,18 @@ NULL
#'
NULL

##################################################
##################################################
#' Report stations along transect design
#'
#' The ReportStationsAlongTransectDesignData model data is a table with the columns Stratum, giving the Stratum name, and NumberOfStationssegments, giving the number of stations in each Stratum, contained in the \code{\link{StationsAlongTransectDesignData}}.
#'
#' @seealso This data type is produced by \code{\link{ReportStationsAlongTransectDesign}}. See \code{\link{DataTypes}} for a list of all StoX data types produced by \code{\link{RstoxBase}}.
#'
#' @name ReportStationsAlongTransectDesignData
#'
NULL

##################################################
##################################################
#' Stations along transect design as GPX
Expand Down
6 changes: 4 additions & 2 deletions R/Plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -731,8 +731,7 @@ plot_lon_lat <- function(
plotspec$data <- trackData
}



# If the color.track.point and size are given as the name of a column in the data, plot color and size as a function of these columns:
if(length(color.track.point) && color.track.point %in% names(trackData) && length(size) && size %in% names(trackData)) {
# Fix the stroke to the strokeToPointFactor times the size.max (multiply by 1.5 since this seems to be needed in ggplot2:
strokeWidth <- 1.5 * size.max * strokeToPointFactor
Expand All @@ -744,6 +743,7 @@ plot_lon_lat <- function(
stroke = strokeWidth
)
}
# If only the color.track.point is given as the name of a column in the data, plot color as a function of this column, whereas size is assumed to be a numeric:
else if(length(color.track.point) && color.track.point %in% names(trackData)) {
mapping <- ggplot2::aes_string(
x = lon_name,
Expand All @@ -752,6 +752,7 @@ plot_lon_lat <- function(
)
plotspec$size <- size
}
# If only the size is given as the name of a column in the data, plot size as a function of this column, whereas color.track.point is assumed to be a valid color:
else if(length(size) && size %in% names(trackData)) {
# Fix the stroke to the strokeToPointFactor times the size.max (multiply by 1.5 since this seems to be needed in ggplot2:
strokeWidth <- 1.5 * size.max * strokeToPointFactor
Expand All @@ -764,6 +765,7 @@ plot_lon_lat <- function(

plotspec$color <- color.track.point
}
# Otherwise, use the size as a numeric and color.track.point as a valid color:
else {
mapping <- ggplot2::aes_string(
x = lon_name,
Expand Down
2 changes: 1 addition & 1 deletion R/Spatial.R
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ getStratumPolygonList <- function(StratumPolygon) {
#' @details
#' The area output is given in international square nautical miles.
#'
#' The \code{AreaMethod} "Accurate" calculates each stratum are using the function \code{\link[sf]{st_area}} with the stratum transformed to Cartesian coordinates using the WGS84 Lambert Azimuthal Equal Area projection with origin at the centroid of the stratum as calculated from the geographical coordinates (longitude, latitude).
#' The \code{AreaMethod} "Accurate" calculates each stratum using the function \code{\link[sf]{st_area}} with the stratum transformed to Cartesian coordinates using the WGS84 Lambert Azimuthal Equal Area projection with origin at the centroid of the stratum as calculated from the geographical coordinates (longitude, latitude).
#'
#' The \code{AreaMethod} "Simple" is used in StoX 2.7 and earlier versions and kept for backwards compatibility.
#'
Expand Down
Loading
Loading