Skip to content

Commit 2c53a68

Browse files
Version 1.9.0-9002, see NEWS.md.
1 parent 0b2cabc commit 2c53a68

22 files changed

+434
-139
lines changed

DESCRIPTION

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: RstoxData
2-
Version: 1.9.0-9001
3-
Date: 2023-02-24
2+
Version: 1.9.0-9002
3+
Date: 2023-03-06
44
Title: Tools to Read and Manipulate Fisheries Data
55
Authors@R: c(
66
person(given = "Edvin",

NEWS.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
# RstoxData v1.9.0-90010 (2023-01-19 )
1+
# RstoxData v1.9.0-9002 (2023-03-06)
2+
* Updated documentation of StoxAcoustic and StoxBiotic with tables defining each variable.
3+
* Added unit specification of StoxAcoustic and StoxBiotic variables.
4+
* Removed error when filtering BioticData read from ICESBiotic and ICESAcoustic XML.
5+
* Fixed snprintf warnnings.
6+
7+
# RstoxData v1.9.0-9001 (2023-01-19)
28
* Corrected warning " There are more than one 'serialnumber' ..." to end with "More than one serialnumber for the following cruise/station (of the fishstation table of the BioticData):" instead of "Duplicated serialnumber for the following cruise/station (of the fishstation table of the BioticData):".
39
* Corrected warning for more NASC in B than in P.
410
* Corrected warninig for non-supported NMDEhcosounder format from >= 1.4 to >= 1.1.

R/Definitions.R

+102
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,108 @@ initiateRstoxData <- function(){
6767
# )
6868
#)
6969

70+
71+
#### Data type units: ####
72+
dataTypeUnits <- list(
73+
# Quantity:
74+
StoxAcoustic = list(
75+
# Cruise level:
76+
CruiseKey = list(quantity = "NA", unit = "NA"),
77+
Cruise = list(quantity = "NA", unit = "NA"),
78+
Platform = list(quantity = "NA", unit = "NA"),
79+
# Log level:
80+
LogKey = list(quantity = "NA", unit = "NA"),
81+
Log = list(quantity = "NA", unit = "NA"),
82+
EDSU = list(quantity = "NA", unit = "NA"),
83+
DateTime = list(quantity = "datetime", unit = "ISO8601"),
84+
Longitude = list(quantity = "angle", unit = "degree east"),
85+
Latitude = list(quantity = "angle", unit = "degree north"),
86+
LogOrigin = list(quantity = "NA", unit = "NA"),
87+
Longitude2 = list(quantity = "angle", unit = "degree east"),
88+
Latitude2 = list(quantity = "angle", unit = "degree north"),
89+
LogOrigin2 = list(quantity = "NA", unit = "NA"),
90+
LogDistance = list(quantity = "length", unit = "nmi"),
91+
LogDuration = list(quantity = "time", unit = "s"),
92+
EffectiveLogDistance = list(quantity = "length", unit = "nmi"),
93+
BottomDepth = list(quantity = "length", unit = "m"),
94+
# Beam level:
95+
BeamKey = list(quantity = "NA", unit = "NA"),
96+
Beam = list(quantity = "NA", unit = "NA"),
97+
Frequency = list(quantity = "frequency", unit = "hertz"),
98+
# AcousticCategory level:
99+
AcousticCategoryKey = list(quantity = "NA", unit = "NA"),
100+
AcousticCategory = list(quantity = "NA", unit = "NA"),
101+
# ChannelReference level:
102+
ChannelReferenceKey = list(quantity = "NA", unit = "NA"),
103+
ChannelReferenceType = list(quantity = "NA", unit = "NA"),
104+
ChannelReferenceDepth = list(quantity = "length", unit = "m"),
105+
ChannelReferenceTilt = list(quantity = "angle", unit = "degree"),
106+
# NASC level:
107+
NASCKey = list(quantity = "NA", unit = "NA"),
108+
Channel = list(quantity = "NA", unit = "NA"),
109+
MaxChannelRange = list(quantity = "length", unit = "m"),
110+
MinChannelRange = list(quantity = "length", unit = "m"),
111+
NASC = list(quantity = "NASC", unit = "m^2/nmi^2")
112+
),
113+
StoxBiotic = list(
114+
# Cruise level:
115+
CruiseKey = list(quantity = "NA", unit = "NA"),
116+
Cruise = list(quantity = "NA", unit = "NA"),
117+
Platform = list(quantity = "NA", unit = "NA"),
118+
# Station level:
119+
StationKey = list(quantity = "NA", unit = "NA"),
120+
Station = list(quantity = "NA", unit = "NA"),
121+
CatchPlatform = list(quantity = "NA", unit = "NA"),
122+
DateTime = list(quantity = "datetime", unit = "ISO8601"),
123+
Longitude = list(quantity = "angle", unit = "degree east"),
124+
Latitude = list(quantity = "angle", unit = "degree north"),
125+
BottomDepth = list(quantity = "length", unit = "m"),
126+
# Haul level:
127+
HaulKey = list(quantity = "NA", unit = "NA"),
128+
Haul = list(quantity = "NA", unit = "NA"),
129+
Gear = list(quantity = "NA", unit = "NA"),
130+
TowDistance = list(quantity = "length", unit = "nmi"),
131+
EffectiveTowDistance = list(quantity = "length", unit = "nmi"),
132+
MinHaulDepth = list(quantity = "length", unit = "m"),
133+
MaxHaulDepth = list(quantity = "length", unit = "m"),
134+
VerticalNetOpening = list(quantity = "length", unit = "m"),
135+
HorizontalNetOpening = list(quantity = "lengthlength", unit = "m"),
136+
TrawlDoorSpread = list(quantity = "length", unit = "m"),
137+
# SpeciesCategory level:
138+
SpeciesCategoryKey = list(quantity = "NA", unit = "NA"),
139+
SpeciesCategory = list(quantity = "NA", unit = "NA"),
140+
# Sample level:
141+
SampleKey = list(quantity = "NA", unit = "NA"),
142+
Sample = list(quantity = "NA", unit = "NA"),
143+
CatchFractionWeight = list(quantity = "mass", unit = "kg"),
144+
CatchFractionNumber = list(quantity = "cardinality", unit = "individuals"),
145+
SampleWeight = list(quantity = "mass", unit = "kg"),
146+
SampleNumber = list(quantity = "cardinality", unit = "individuals"),
147+
# Individual level:
148+
IndividualKey = list(quantity = "NA", unit = "NA"),
149+
Individual = list(quantity = "NA", unit = "NA"),
150+
IndividualRoundWeight = list(quantity = "length", unit = "g"),
151+
IndividualTotalLength = list(quantity = "length", unit = "cm"),
152+
LengthResolution = list(quantity = "length", unit = "cm"),
153+
WeightMeasurement = list(quantity = "NA", unit = "NA"),
154+
IndividualAge = list(quantity = "age", unit = "year"),
155+
IndividualSex = list(quantity = "NA", unit = "NA")
156+
),
157+
SuperIndividualsData = list(
158+
IndividualTotalLength = list(quantity = "length", unit = "cm"),
159+
IndividualRoundWeight = list(quantity = "mass", unit = "g"),
160+
Abundance = list(quantity = "cardinality", unit = "individuals"),
161+
Biomass = list(quantity = "mass", unit = "g"),
162+
TowDistance = list(quantity = "length", unit = "nmi"),
163+
EffectiveTowDistance = list(quantity = "length", unit = "nmi"),
164+
CatchFractionWeight = list(quantity = "mass", unit = "kg"),
165+
CatchFractionNumber = list(quantity = "cardinality", unit = "individuals"),
166+
SampleWeight = list(quantity = "mass", unit = "kg"),
167+
SampleNumber = list(quantity = "cardinality", unit = "individuals"),
168+
IndividualAge = list(quantity = "age", unit = "year")
169+
)
170+
)
171+
70172
targetAndSourceVariables <- list(
71173
target = "TargetVariable",
72174
source = "SourceVariable"

R/Filter.R

+1-4
Original file line numberDiff line numberDiff line change
@@ -180,9 +180,6 @@ filterTables <- function(inputTables, filterExpression, treeStruct, propagateDow
180180
if (!any(names(inputTables) %in% names(treeStruct)) & length(inputTables)>1){
181181
stop("Argument 'treeStruct' does not specify a hierarchy for 'inputTables'.")
182182
}
183-
if (length(treeStruct) >0 & !all(names(treeStruct) %in% names(inputTables))){
184-
stop("Argument 'treeStruct' does not specify a hierarchy for 'inputTables'.")
185-
}
186183

187184
`%notin%` <- Negate(`%in%`)
188185

@@ -323,7 +320,7 @@ filterData <- function(inputData, filterExpression, propagateDownwards = TRUE, p
323320
getTreestruct <- function(tables){
324321
#extract treeStruct for xsd
325322
if (!useXsd){
326-
levels <- names(tables)[names(tables) != "metadata"]
323+
levels <- setdiff(names(tables), "metadata")
327324
treeStruct <- as.list(tail(levels,-1))
328325
names(treeStruct) <- head(levels,-1)
329326

R/StoxAcoustic.R

+2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
#'
55
#' @return An object of StoX data type \code{\link{StoxAcousticData}}.
66
#'
7+
#' @seealso The definition of the \code{\link[=StoxAcousticFormat]{StoxAcoustic format}} and \code{\link{generalSamplingHierarhcy}}.
8+
#'
79
#' @export
810
#'
911
StoxAcoustic <- function(AcousticData){

R/StoxExport.R

+4-2
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,8 @@ checkICESAcousticDefinitions <- function(ICESAcousticDataOne) {
355355
#' @param ICESAcousticData A \code{\link{ICESAcousticData}} object obtained from an ICES acoustic XML format file.
356356
#'
357357
#' @return List of string matrices in the ICES acoustic CSV format.
358+
#'
359+
#' @return An object of StoX data type \code{\link{WriteICESAcousticData}}.
358360
#'
359361
#' @export
360362
#'
@@ -888,7 +890,7 @@ changeClassOfNonNA <- function(name, classes, data) {
888890
#'
889891
#' @param ICESBioticData A \code{\link{ICESBioticData}} object obtained from an ICES acoustic XML format file.
890892
#'
891-
#' @return List of string matrices in the ICES acoustic CSV format.
893+
#' @return #' @return An object of StoX data type \code{\link{WriteICESBioticData}}.
892894
#'
893895
#' @export
894896
WriteICESBiotic <- function(ICESBioticData){
@@ -1906,7 +1908,7 @@ getHighestResolution <- function(table) {
19061908
#'
19071909
#' @inheritParams ModelData
19081910
#'
1909-
#' @return List of string matrices in the ICES Datras CSV format.
1911+
#' @return An object of StoX data type \code{\link{WriteICESDatrasData}}.
19101912
#'
19111913
#' @export
19121914
WriteICESDatras <- function(ICESDatrasData){

0 commit comments

Comments
 (0)