Skip to content

Commit 2756da4

Browse files
authored
Merge pull request #199 from StoXProject/testing
Testing
2 parents 7fd7e6c + 33b1330 commit 2756da4

File tree

76 files changed

+5164
-396
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+5164
-396
lines changed

Diff for: .Rbuildignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
^.*\.Rproj$
22
^\.Rproj\.user$
3-
^\.travis\.yml$
4-
^appveyor\.yml$
53
^\.github
64
^LICENSE$
75
^doc$
6+
^docs$
7+
^pkgdown$
88
^Meta$

Diff for: .github/workflows/check-full.yaml

+20-23
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,18 @@ jobs:
2525
config:
2626
# for windows and mac all builds are pushed to drat repo on merge to master (except pre-release builds), except 'next'
2727

28-
- {os: macOS-latest, r: 'next', pkgext: '.tgz'} # will be tested without suggests
28+
# - {os: macOS-latest, r: 'next', pkgext: '.tgz'} # will be tested without suggests
2929
- {os: macOS-latest, r: '4.3', pkgext: '.tgz'} # will be tested without suggests
3030
- {os: macOS-latest, r: '4.4', pkgext: '.tgz'} # will be tested without suggests
31-
32-
- {os: windows-latest, r: 'next', pkgext: '.zip'}
31+
32+
# - {os: windows-latest, r: 'next', pkgext: '.zip'}
3333
- {os: windows-latest, r: '4.3', pkgext: '.zip'}
3434
- {os: windows-latest, r: '4.4', pkgext: '.zip'}
35+
3536

36-
# - {os: ubuntu-latest, r: 'next', pkgext: '.tar.gz', rspm: "https://cloud.r-project.org"}
37-
# 4.3 is pushed to drat repo on merge to master for ubunutu (except pre-release builds), update script if 4.3 is taken out
37+
# - {os: ubuntu-latest, r: 'next', pkgext: '.tar.gz', rspm: "https://cloud.r-project.org"}
3838
- {os: ubuntu-22.04, r: '4.3', pkgext: '.tar.gz', rspm: "https://cloud.r-project.org"}
39+
# 4.3 is pushed to drat repo on merge to master for ubunutu (except pre-release builds), update script if 4.3 is taken out
3940
- {os: ubuntu-22.04, r: '4.4', pkgext: '.tar.gz', rspm: "https://cloud.r-project.org"}
4041

4142
env:
@@ -97,34 +98,30 @@ jobs:
9798
while read -r cmd
9899
do
99100
eval sudo $cmd
100-
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "20.04"))')
101+
done < <(Rscript -e 'writeLines(remotes::system_requirements("ubuntu", "22.04"))')
101102
102103
- name: Install MacOS system dependencies
103104
if: runner.os == 'macOS'
104105
run: |
105-
# gfortran may not exist in a period after a new R minor release:
106-
gfortranFile='/usr/local/bin/gfortran'
107-
if [ -f "$gfortranFile" ] ; then
108-
rm "$gfortranFile"
109-
fi
110-
rm '/usr/local/bin/2to3'
111-
rm '/usr/local/bin/2to3-3.11'
112-
rm '/usr/local/bin/idle3.11'
113-
rm '/usr/local/bin/idle3'
114-
rm '/usr/local/bin/pydoc3'
115-
rm '/usr/local/bin/python3'
116-
rm '/usr/local/bin/python3-config'
117-
rm '/usr/local/bin/pydoc3.11'
118-
rm '/usr/local/bin/python3.11'
119-
rm '/usr/local/bin/python3.11-config'
106+
rm -f '/usr/local/bin/gfortran'
107+
rm -f '/usr/local/bin/2to3'
108+
rm -f '/usr/local/bin/2to3-3.11'
109+
rm -f '/usr/local/bin/idle3'
110+
rm -f '/usr/local/bin/idle3.11'
111+
rm -f '/usr/local/bin/pydoc3'
112+
rm -f '/usr/local/bin/pydoc3.11'
113+
rm -f '/usr/local/bin/python3'
114+
rm -f '/usr/local/bin/python3.11'
115+
rm -f '/usr/local/bin/python3-config'
116+
rm -f '/usr/local/bin/python3.11-config'
120117
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=false # This prevents Homebrew from re-installing R, which will lead to .Platform$pkgType = "source".
121-
brew install gdal udunits
118+
brew install gdal
122119
shell: bash
123120

124121
- name: Prepare for dependencies on Linux
125122
if: runner.os == 'Linux'
126123
run: |
127-
sudo apt-get install libgdal-dev libproj-dev libgeos-dev libudunits2-dev
124+
sudo apt-get install -y libgdal-dev libproj-dev libgeos-dev libudunits2-dev
128125
shell: bash
129126

130127
- name: Install dependencies on Linux

Diff for: DESCRIPTION

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: RstoxFDA
2-
Version: 1.4.0
3-
Date: 2024-10-25
2+
Version: 1.6.0
3+
Date: 2025-03-18
44
Title: Fisheries Dependent Analysis with RstoX
55
Authors@R: c(
66
person(given = "Edvin",
@@ -26,8 +26,8 @@ Imports:
2626
RColorBrewer (>= 1.1-2),
2727
rnaturalearth (>= 1.0.1),
2828
rnaturalearthdata (>= 1.0.0),
29-
RstoxBase (>= 2.1.0),
30-
RstoxData (>= 2.1.0),
29+
RstoxBase (>= 2.1.1),
30+
RstoxData (>= 2.1.1),
3131
sf (>= 1.0.0),
3232
stats (>= 3.5.0),
3333
utils (>= 3.5.0)
@@ -38,4 +38,5 @@ Suggests:
3838
tinytest
3939
Additional_repositories:
4040
https://stoxproject.github.io/repo
41+
VignetteBuilder: knitr
4142
RoxygenNote: 7.3.2

Diff for: NAMESPACE

+21
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,20 @@
33
export(AddAreaPositionStoxLanding)
44
export(AddGearGroupStoxBiotic)
55
export(AddGearGroupStoxLanding)
6+
export(AddLengthGroupStoxBiotic)
67
export(AddPeriodStoxBiotic)
78
export(AddPeriodStoxLanding)
9+
export(AddPsuStratificationVariables)
810
export(AddStratumStoxBiotic)
911
export(AddStratumStoxLanding)
12+
export(AggregateAnalyticalEstimate)
13+
export(AnalyticalPSUEstimate)
14+
export(AnalyticalPopulationEstimate)
15+
export(AnalyticalRatioEstimate)
16+
export(AssignPSUSamplingParameters)
17+
export(CollapseStrata)
18+
export(ComputeIndividualSamplingParameters)
19+
export(ComputePSUSamplingParameters)
1020
export(ConvertLengthBiotic)
1121
export(ConvertWeightBiotic)
1222
export(DefineAgeErrorMatrix)
@@ -16,8 +26,11 @@ export(DefineLengthConversionParameters)
1626
export(DefinePeriod)
1727
export(DefineStockSplittingParameters)
1828
export(DefineWeightConversionFactor)
29+
export(ExtendAnalyticalSamplingFrameCoverage)
1930
export(FilterAgeLengthOutliersStoxBiotic)
2031
export(FilterWeightLengthOutliersStoxBiotic)
32+
export(InterpolateAnalyticalDomainEstimates)
33+
export(LiftStrata)
2134
export(ListBioticDifference)
2235
export(LoadFdaStratumPolygon)
2336
export(ParameterizeRecaModels)
@@ -32,6 +45,11 @@ export(PlotSamplingOverviewCell)
3245
export(PlotSamplingVariables)
3346
export(PrepareRecaEstimate)
3447
export(ReadLandingFDA)
48+
export(ReadPSUSamplingParameters)
49+
export(ReportAnalyticalCatchAtAge)
50+
export(ReportAnalyticalCatchAtLength)
51+
export(ReportAnalyticalLengthAtAge)
52+
export(ReportAnalyticalWeightAtAge)
3553
export(ReportFdaLandings)
3654
export(ReportFdaSOP)
3755
export(ReportFdaSampling)
@@ -106,5 +124,8 @@ export(sourceLogbookColumns)
106124
export(stoxFunctionAttributes)
107125
export(tabulateFisheries)
108126
export(writeSpDataFrameAsWKT)
127+
import(RstoxBase)
128+
import(methods)
129+
import(rnaturalearthdata)
109130
importFrom(data.table,.SD)
110131
importFrom(ggplot2,.data)

Diff for: NEWS.md

+27-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# RstoxFDA v1.6
2+
* Fixed issue with plotting with other column variables than 'Area' in PlotFisheriesOverviewSpatial (#147)
3+
* Fixed ordering of age groups in ReportAnalyticalCatchAtAge (#134)
4+
* Added documentation for ECA convergence analsysis (#153)
5+
* Added functions for analytical catch at age estimation (ComputePSUSamplingParameters, ComputeIndividualSamplingParameters, AssignPSUSamplingParameters, AnalyticalPSUEstimate, AnalyticalPopulationEstimate, AnalyticalRatioEstimate, ReportAnalyticalCatchAtAge, InterpolateAnalyticalDomainEstimates, ExtendAnalyticalSamplingFrameCoverage, ComputePSUSamplingParameters, AddPsuStratificationVariables, AddLengthGroupStoxBiotic, ReportAnalyticalCatchAtLength, ReportAnalyticalLengthAtAge, ReportAnalyticalWeightAtAge)
6+
* Converted area code resources from sp SpatialPolygons to sf data.frames, reflecting changes in RstoxBase v 2. Breaks compatibility with RstoxBase < 2.
7+
* Made definition of coordinates used for appendAreaCodes and DefineAreaPosition stricter (now always centroids)
8+
* Made appendAreaCodes and DefineAreaPosition look for intersects in mercator projection
9+
* Changed ReadLandingFDA to use ForceUnique as implemented in RstoxData v 2. Breaks compatibility with RstoxData < 2
10+
* Changed the signature of mergePolygons to work with sf data.frames rather than sp SpatialPolygons.
11+
* Changed the definition neighbours in DefineCarNeighbours from polygons touching to polygons within 1 metre distance in mercator projection.
12+
* Changed areaCodeConversionTable to work with provided area definitions in mercator projection
13+
14+
115
# RstoxFDA v1.4
216
* Converted area code resources from sp SpatialPolygons to sf data.frames, reflecting changes in RstoxBase v 2. Breaks compatibility with RstoxBase < 2.
317
* Changed ReadLandingFDA to use ForceUnique as implemented in RstoxData v 2. Breaks compatibility with RstoxData < 2
@@ -17,6 +31,18 @@
1731
* Added guidance to vignettes about how to deal with several hauls assigned the same station when the field 'station' is not correctly filled in NMDbiotic.
1832
* Added workaround so that the non-linear option for lgamodel can be used with with all version of Reca.
1933

34+
# RstoxFDA v1.3-9002
35+
* Fixed issue with PlotMeanWeightAtAge and PlotMeanLengthAtAge that would not plot mean values for configurations with no grouping variables
36+
* Fixed issue where the DefineCarNeighbours would format column headers differently depending on the chosen DefinitionMethods. The column header 'CarValue' is now consistently written in the singular form, which means that output from the DefinitionMethod 'StratumPolygon' has changed, and the json schema for CarNeighbours has changed.
37+
* Fixed the behavior of AddStratumStoxLanding so that it assigns area NA, rather than halting with error, when positions cannot be assigned to an area.
38+
* Fixed the behavior of ReportFdaSampling to count catches as unique hauls (column Haul on StoxBiotic$Haul), rather than stations. Improved documentation for the same function.
39+
* Added checking on the validity of IntervalWidths in report functions that report Reca-credible intervals
40+
* Clarified various warnings and error messages.
41+
* Made provision of area definition optional in PlotArea, so that the function can be used to examine the spatial distribution of data without providing a spatial coding system, or to just make maps without providing either data or area definitions.
42+
* Refactored to get rid of usages of ggplot::aes_string which is soft deprecated by ggplot.
43+
* Added guidance to vignettes about how to deal with several hauls assigned the same station when the field 'station' is not correctly filled in NMDbiotic.
44+
* Added workaround so that the non-linear option for lgamodel can be used with with all version of Reca.
45+
2046
# RstoxFDA v1.2.0 (2023-01-24)
2147
* Bumped version number in order to get latest release in line with semantic versioning
2248

@@ -28,4 +54,4 @@
2854
* Fixed json-schema for AgeErrorMatrix (#75)
2955

3056
# RstoxFDA v1.1.0 (2022-11-26)
31-
* contrary to what version numbers indicate, this was released before v1.1.0-9001.
57+
* contrary to what version numbers indicate, this was released before v1.1.0-9001.

Diff for: R/GSAsubAreas-datadoc.R

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#'
2222
#' @concept area code polygons
2323
#' @keywords datasets
24+
#' @import RstoxBase
2425
#'
2526
#'
2627
#' @examples

Diff for: R/ICESareas-datadoc.R

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#'
2929
#' @concept area code polygons
3030
#' @keywords datasets
31+
#' @import RstoxBase
3132
#'
3233
#' @seealso \code{\link[RstoxFDA]{ICESsubArea}}, \code{\link[RstoxFDA]{ICESdivision}}, \code{\link[RstoxFDA]{ICESsubDivision}}, and \code{\link[RstoxFDA]{ICESunit}}
3334
#' for polygon files separating the different levels of ICES areas.

Diff for: R/ICESdivision-datadoc.R

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#'
1717
#' @concept area code polygons
1818
#' @keywords datasets
19+
#' @import RstoxBase
1920
#'
2021
#' @examples
2122
#' # plot ICES areas

Diff for: R/ICESrectangles-datadoc.R

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#'
3131
#' @concept area code polygons
3232
#' @keywords datasets
33+
#' @import RstoxBase
3334
#'
3435
#' @examples
3536
#' # plot statistical rectangles in 27.3.a

Diff for: R/ICESsubArea-datadoc.R

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#'
1616
#' @concept area code polygons
1717
#' @keywords datasets
18+
#' @import RstoxBase
1819
#'
1920
#' @examples
2021
#' # plot ICES areas

Diff for: R/ICESsubDivision-datadoc.R

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#'
1717
#' @concept area code polygons
1818
#' @keywords datasets
19+
#' @import RstoxBase
1920
#'
2021
#' @examples
2122
#' # plot ICES areas

Diff for: R/ICESunit-datadoc.R

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#'
1717
#' @concept area code polygons
1818
#' @keywords datasets
19+
#' @import RstoxBase
1920
#'
2021
#' @examples
2122
#' # plot ICES areas

Diff for: R/NAFOareas-datadoc.R

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#'
2121
#' @concept area code polygons
2222
#' @keywords datasets
23+
#' @import RstoxBase
2324
#'
2425
#' @examples
2526
#' # combine NAFO and mainarea and plot

Diff for: R/StoxAnalysisFunctions.R

+2-1
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ warnMissingLandings <- function(StoxBiotic, StoxLanding, effects){
263263
#' and \code{\link[RstoxData]{AddToStoxBiotic}} for adding otolith-type to samples for stock-splitting analysis.
264264
#' @concept StoX-Reca functions
265265
#' @concept StoX-functions
266+
#' @import RstoxBase
266267
#' @export
267268
#' @md
268269
PrepareRecaEstimate <- function(StoxBioticData, StoxLandingData, FixedEffects=character(), RandomEffects=character(), UseCarEffect=FALSE, CarEffect=character(), CarNeighbours, UseAgingError=FALSE, AgeErrorMatrix, UseStockSplitting=FALSE, UseStockSplittingError=FALSE, StockSplittingParameters, CellEffect=c("Off", "All"), MinAge=integer(), MaxAge=integer(), MaxLength=numeric(), LengthResolution=numeric(), HatchDay=integer()){
@@ -701,7 +702,7 @@ getLandingsFromStoxLandings <- function(RecaParameterData, StoxLandingData, Temp
701702
quarter <- data.table::quarter(StoxLandingData$Landing$CatchDate)
702703
}
703704
else if (TemporalResolution == "Month"){
704-
month <- month(StoxLandingData$Landing$CatchDate)
705+
month <- data.table::month(StoxLandingData$Landing$CatchDate)
705706
}
706707
else if (TemporalResolution == "Day"){
707708
date <- StoxLandingData$Landing$CatchDate

Diff for: R/StoxAnalyticalAnalysisFunctions.R

-3
This file was deleted.

0 commit comments

Comments
 (0)