Skip to content

Commit 5ad070d

Browse files
Merge pull request #471 from StoXProject/develop
Develop
2 parents c22ee69 + 94b6699 commit 5ad070d

45 files changed

Lines changed: 1157 additions & 1513 deletions

Some content is hidden

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

.github/workflows/check-full.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ jobs:
2828
- {os: macOS-latest, r: 'release', pkgext: '.tgz'}
2929
- {os: macOS-latest, r: 'oldrel', pkgext: '.tgz'}
3030

31-
# macOS-13 will use the big-sur-x86_64 folder when deploying to the drat repo:
32-
- {os: macOS-13, r: 'release', pkgext: '.tgz'}
33-
- {os: macOS-13, r: 'oldrel', pkgext: '.tgz'}
31+
# macos-15-intel will use the big-sur-x86_64 folder when deploying to the drat repo. This is the last intel-macOS supported by GitHub Actions:
32+
- {os: macos-15-intel, r: 'release', pkgext: '.tgz'}
33+
- {os: macos-15-intel, r: 'oldrel', pkgext: '.tgz'}
3434

3535
- {os: windows-latest, r: 'release', pkgext: '.zip'}
3636
- {os: windows-latest, r: 'oldrel', pkgext: '.zip'}

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: RstoxData
2-
Version: 2.2.0-9007
3-
Date: 2025-12-01
2+
Version: 2.2.0-9008
3+
Date: 2025-12-15
44
Title: Tools to Read and Manipulate Fisheries Data
55
Authors@R: c(
66
person(given = "Arne Johannes",

NAMESPACE

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22

33
export(AddToStoxBiotic)
44
export(CompensateEffectiveTowDistanceForFishingDepthCount)
5-
export(ConvertAcoustic)
6-
export(ConvertBiotic)
7-
export(ConvertStoxAcoustic)
8-
export(ConvertStoxBiotic)
95
export(CopyAcoustic)
106
export(CopyBiotic)
117
export(CopyICESAcoustic)

NEWS.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
# RstoxData v2.2.0-9008 (2025-12-15)
2+
* Added support for specifying a function in NewValue in TranslationTable in Translate functions. This allows for mathematical transformation of values, e.g. IndividualTotalLength * 0.9 to get total length from fork length
3+
* Added the possibility to condition on variables present in parent tables in Translate functions. This can be useful e.g. when translating variables in the Individual table of StoxBiotic conditioned on SpeciesCategory (which is found two tables up in the SpeciesCategory table).
4+
* Restricted LengthType accepted to only "1" from ICESBiotic XML files in the StoxBiotic() function, equivalent to the only accepted lengthmeasurement "E" from NMDBiotic XML files.
5+
* Fixed bug where the only the first Survey from the Survey table of BioticData read from ICESBiotic XML files was added to the Cruise table. In the ICESBiotic CSV file multiple surveys concatenated with "~" as separator, which is not adopted in RstoxData.
6+
* Changed the warning i StoxBiotic() for non-total length (lengthmeasurement != "E" or LengthType != "1") to not list the species, but rather inform about the possibility to transform the length values using Translate functions.
7+
* Removed the argument useXsd from filterData(), which was used to ignore the table hierarchy provided in the RstoxData::xsdObjects.
8+
* Added the LocalID as key field in the Survey table of BioticData and AcousticData when read from ICES XML files.
9+
* Updated documentation of DefineTranslation().
10+
* Added the element keys to xsdObjects. Keys of other data than input data are defined in initiateRstoxData().
11+
* Discovered that only the last entry of the Survey table is read by ReadBiotic/ReadAcoustic.
12+
* Removed the iskey = Y for PreySpeciesCategory in stox-biotic-final-phase.csv.
13+
* Put convertLen() into getIndividualTotalLength_ICESBiotic() in processBioticData.R.
14+
* Removed the following functions that were exported but not exposed in the StoX GUI: ConvertStoxBiotic(), ConvertStoxAcoustic(), ConvertBiotic() and ConvertAcoustic(). These were not working, but the intended use can now be achieved using a numeric function in the NewValue field of a TranslationTable og Translate functions.
15+
* Now passing keys to the function translateVariables() in TranslateICESAcoustic(), TranslateICESBiotic(), TranslateICESDatras() and TranslateICESDatsusc().
16+
17+
18+
119
# RstoxData v2.2.0-9006 (2025-11-01)
220
* Changed to hard coding UnitWgt to "kg" and UnitLngt to "m" in ICESDatsusc().
321

R/DefineAndUpdateVariables.R

Lines changed: 274 additions & 739 deletions
Large diffs are not rendered by default.

R/Definitions.R

Lines changed: 56 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -33,27 +33,63 @@ initiateRstoxData <- function(){
3333
"nmdbioticv1.4"
3434
)
3535

36-
# StoxBioticKeys:
37-
StoxBioticKeys <- c(
38-
"CruiseKey",
39-
"StationKey",
40-
"HaulKey",
41-
"SpeciesCategoryKey",
42-
"SampleKey",
43-
"IndividualKey",
44-
"PreySpeciesCategoryKey",
45-
"PreySampleKey",
46-
"PreyIndividualKey"
47-
)
48-
# StoxBioticKeys:
49-
StoxAcousticKeys <- c(
50-
"CruiseKey",
51-
"LogKey",
52-
"BeamKey",
53-
"AcousticCategoryKey",
54-
"ChannelReferenceKey",
55-
"NASCKey"
36+
# The keys of the input data StoxAcoustic (NMDEchosounder and ICESAcoustic) and StoxBiotic (NMDBiotic and ICESBiotic) (NMDLanding does not have a heirarchical data model) are defined in the RstoxData::xsdObjects. Here, we the keys of the StoxAcousticData and StoxBioticData as well as ICESDatrasData and ICESDatsuscData. The ICESAcousticData and ICESBioticData use expandICESKeysWithPrefix() to add table name as prefix to the keys defined in the RstoxData::xsdObjects (see TranslateICESAcoustic and TranslateICESBiotic):
37+
keys <- list(
38+
# StoxBiotic keys:
39+
StoxBiotic = list(
40+
Cruise = "CruiseKey",
41+
Station = "StationKey",
42+
Haul = "HaulKey",
43+
SpeciesCategory = "SpeciesCategoryKey",
44+
Sample = "SampleKey",
45+
Individual = "IndividualKey",
46+
PreySpeciesCategory = "PreySpeciesCategoryKey",
47+
PreySample = "PreySampleKey",
48+
PreyIndividual = "PreyIndividualKey"
49+
),
50+
# StoxAcoustic keys:
51+
StoxAcoustic = list(
52+
Cruise = "CruiseKey",
53+
Log = "LogKey",
54+
Beam = "BeamKey",
55+
AcousticCategory = "AcousticCategoryKey",
56+
ChannelReference = "ChannelReferenceKey",
57+
NASC = "NASCKey"
58+
),
59+
# ICESDatras keys:
60+
ICESDatras = list(
61+
HH = c(
62+
"Quarter",
63+
"Country",
64+
"Platform",
65+
"Gear",
66+
"HaulNumber"
67+
),
68+
HL = c(
69+
"Quarter",
70+
"Country",
71+
"Platform",
72+
"Gear",
73+
"HaulNumber",
74+
"SpeciesCode",
75+
"LengthClass"
76+
),
77+
CA = c(
78+
"Quarter",
79+
"Country",
80+
"Platform",
81+
"Gear",
82+
"HaulNumber",
83+
"SpeciesCode",
84+
"LengthClass",
85+
"FishID"
86+
)
87+
)
5688
)
89+
# Add the ICESDatsusc keys as the same as the ICESDatras:
90+
keys$ICESDatsusc <- keys$ICESDatras
91+
92+
5793

5894
#dataTypeDefinition <- list(
5995
# # StoxAcousticDat:
@@ -185,29 +221,9 @@ initiateRstoxData <- function(){
185221
)
186222
dataTypeUnits <- data.table::rbindlist(dataTypeUnits)
187223

188-
189-
targetAndSourceVariables <- list(
190-
target = "TargetVariable",
191-
source = "SourceVariable"
192-
)
193-
194224
# Define the columns required for VariableConversionTable:
195225
TranslationOldRequiredColumns <- c("VariableName", "Value", "NewValue")
196226

197-
# Define the ICESBiotic keys (check with the package author whether this is already defined when reading the data):
198-
ICESAcousticKeys <- list(
199-
Cruise = "LocalID",
200-
Log = c("LocalID", "Distance"),
201-
Sample = c("LocalID", "Distance", "ChannelDepthUpper"),
202-
Data = c("LocalID", "Distance", "ChannelDepthUpper", "SaCategory")
203-
)
204-
ICESBioticKeys <- list(
205-
Cruise = "LocalID",
206-
Haul = c("LocalID", "Gear", "Number"),
207-
Catch = c("LocalID", "Gear", "Number", "SpeciesCode", "SpeciesCategory"),
208-
Biology = c("LocalID", "Gear", "Number", "SpeciesCode", "SpeciesCategory", "StockCode", "FishID")
209-
)
210-
211227
# A function to extract the implemented xml formats for each of the types "biotic", "acoustic" and "landing":
212228
getImplementedXsd <- function(type = c("Biotic", "Acoustic", "Landing")) {
213229
type <- match_arg_informative(type)

0 commit comments

Comments
 (0)