You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: NEWS.md
+6
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,9 @@
1
+
# RstoxData v2.1.1_9001 (2024-11-25)
2
+
* Removed rscript_args from mapplyOnCores(), since this caused the Renviron to be ignored in the sub processes, resulting in errors with finding RstoxFramework in the case of multiple libraries on Linux and macOS.
3
+
* Fixed the 29 cm bug again, as it was not properly fixed in RstoxData v2.1.0. Refactored how precision is set both when reading data and in the ICESBiotic() and ICESAcoustic().
4
+
* Introduced the EchoType as a column in the Data table of ICESBiotic() (and WriteICESBiotic()).
5
+
6
+
1
7
# RstoxData v2.1.0 (2024-11-04)
2
8
* Final release for StoX 4.1.0.
3
9
* Fixed bug in DefineTranslation, where the ConditionalVariableNames was showing as a single string and not a vector.
# Set classes of the variables, especially taking care of NAs. The class of the variables is used later to format the output from WriteICESAcoustic, where NA double type is stored as empty sting to support these beingg empty fields in the written file:
# Set classes of the variables, especially taking care of NAs. The class of the variables is used later to format the output from WriteICESBiotic, where NA double type is stored as empty sting to support these being empty fields in the written file:
# Removed this by a special function that converts to integer after rounding to avoid problems like trunc(0.29 * 100) == 28:
943
-
# I.e., convertion from float to integer performs in the same way as trunc(), which has problems with floating numbers. For the fish lengths that are relevant we have the problem for the following values:
# This operation requires that the input can be represented as numeric, so we test that first by observing whether the number of missing values increases:
974
-
x_numeric<- as.numeric(x)
975
-
numberOfNAs<- sum(is.na(x))
976
-
numberOfNAs_numeric<- sum(is.na(x_numeric))
977
-
if(numberOfNAs_numeric>numberOfNAs) {
978
-
warning("StoX: NAs introduced when trying to convert to integer.")
979
-
return(as.integer)
980
-
}
981
-
982
-
# Convert to integer:
983
-
x_integer<- as.integer(x)
984
-
# Find values which differ to the integer value by less than the input precision, and round these off before converting to integer to avoid occasional shifts in integer value due to floating point representation (e.g. as.integer(0.29 * 100) == 28):
# Handle empty data. This is only relevant for NMDBiotic and NMDAcoustic, which both have levels with no data (i.e. "missions" and "distance_list", respectively):
# Set types of the columns of the table named 'tableName' of 'data'. Note that this only considers the columns with names present in the xsd$tableHeader. For ICES formats the keys are not included in the tableHeader, but all keys are character
modifiedWarning<- paste0("The following variable could not converted to numeric as per the format definition and were set to NA: ", names(data[[tableName]])[i])
# This operation requires that the input can be represented as numeric, so we test that first by observing whether the number of missing values increases:
1151
+
x_numeric<- as.numeric(x)
1152
+
x_integer<- as.integer(x)
1153
+
1154
+
# Detect whether the input is not fully convertible to integer, which we assume is the case if there are mote missing values in the x_numeric, in which case we simply return the x_integer:
1155
+
numberOfNAs<- sum(is.na(x))
1156
+
numberOfNAs_numeric<- sum(is.na(x_numeric))
1157
+
if(numberOfNAs_numeric>numberOfNAs) {
1158
+
warning("StoX: NAs introduced when trying to convert to integer.")
1159
+
return(x_integer)
1160
+
}
1161
+
1162
+
# Convert to integer:
1163
+
x_integer<- as.integer(x)
1164
+
x_rounded<- round(x_numeric)
1165
+
# Find values which differ to the integer value by less than the input precision, and round these off before converting to integer to avoid occasional shifts in integer value due to floating point representation (e.g. as.integer(0.29 * 100) == 28):
1166
+
diff<-x_numeric-x_rounded
1167
+
atSmallDiff<- which(diff<0&-diff<=prec)
1168
+
1169
+
# Convert to integer after rounding for values that differ to the integer value by less than the prec:
0 commit comments