Skip to content

Commit 9bc28fb

Browse files
Merge pull request #432 from StoXProject/develop
Develop
2 parents 70f694a + bce2b87 commit 9bc28fb

File tree

8 files changed

+18
-13
lines changed

8 files changed

+18
-13
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Package: RstoxData
2-
Version: 2.1.4-9003
2+
Version: 2.1.4-9004
33
Date: 2025-03-27
44
Title: Tools to Read and Manipulate Fisheries Data
55
Authors@R: c(

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# RstoxData v2.1.4-9004 (2025-03-27)
2+
* Updated documentation on WriteICESDatrasData and WriteICESDatsucsData.
3+
4+
15
# RstoxData v2.1.4-9003 (2025-03-27)
26
* Corrected error in ICESDatras() where finalHL was not data.table copied from mergedHL, causing Sex to be NA in the CA table.
37

R/StoxExport.R

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1953,10 +1953,7 @@ WriteICESDatrasOne <- function(ICESDatrasDataOne, na = "-9"){
19531953
ICESDatrasCSVDataOne <- lapply(ICESDatrasCSVDataOne, function(x) {x[is.na(x)] <- na; x})
19541954
}
19551955

1956-
#ICESDatrasCSVDataOne <- expandWidth(ICESDatrasCSVDataOne, na = na)
1957-
1958-
# Stack all matrices:
1959-
#ICESDatrasCSVDataOne <- do.call(rbind, ICESDatrasCSVDataOne)
1956+
# IMPORTANT NOTE: The ICES DATRAS format assumes that the three tables HH, HL and CA are stacked in a comma separated file but without padding the tables to equal number of columns as is done for ICESAcoustic and ICESBiotic. For this reason we need to paste the data to a chatacter vector and write as lines. RstoxFramework detects that the output as a vector of characters and uses writeLines() to produce the file.
19601957

19611958
# Convert each line of each table to comma separated:
19621959
ICESDatrasCSVDataOne <- lapply(ICESDatrasCSVDataOne, apply, 1, paste, collapse = ",")
@@ -2222,6 +2219,10 @@ WriteICESDatsuscOne <- function(ICESDatsuscData, na = "-9"){
22222219
if(length(na)) {
22232220
ICESDatsuscCSVDataOne <- lapply(ICESDatsuscCSVDataOne, function(x) {x[is.na(x)] <- na; x})
22242221
}
2222+
2223+
# IMPORTANT NOTE: The ICES DATRAS format assumes that the three tables HH, HL and CA are stacked in a comma separated file but without padding the tables to equal number of columns as is done for ICESAcoustic and ICESBiotic. For this reason we need to paste the data to a chatacter vector and write as lines. RstoxFramework detects that the output as a vector of characters and uses writeLines() to produce the file.
2224+
2225+
22252226
# Convert each line of each table to comma separated:
22262227
ICESDatsuscCSVDataOne <- lapply(ICESDatsuscCSVDataOne, apply, 1, paste, collapse = ",")
22272228
# Join to one vector, to be written to one file:

R/data.R

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ NULL
503503
#' The output of this function is suited for submission to \url{https://acoustic.ices.dk/}.
504504
#'
505505
#' @details
506-
#' The ICESAcoustic CSV format is one string matrix containing all tables of \code{\link{ICESAcousticData}}, where column names are included as header rows.
506+
#' The ICESAcoustic CSV format is one string matrix containing all tables of \code{\link{ICESAcousticData}}, where column names are included as header rows. RstoxData appends columns with missing values in order to produce this matrix, and this is reflected in the output file written by RstoxFramework.
507507
#'
508508
#' @seealso \code{\link{DataTypes}} for a list of all StoX data types produced by \code{\link{RstoxData}}
509509
#'
@@ -518,7 +518,7 @@ NULL
518518
#' The output of this function is suited for submission to \url{https://acoustic.ices.dk/}.
519519
#'
520520
#' @details
521-
#' The ICESBiotic CSV format is one string matrix containing all tables of \code{\link{ICESBioticData}}, where column names are included as header rows.
521+
#' The ICESBiotic CSV format is one string matrix containing all tables of \code{\link{ICESBioticData}}, where column names are included as header rows. RstoxData appends columns with missing values in order to produce this matrix, and this is reflected in the output file written by RstoxFramework.
522522
#'
523523
#' @seealso \code{\link{DataTypes}} for a list of all StoX data types produced by \code{\link{RstoxData}}
524524
#'
@@ -533,7 +533,7 @@ NULL
533533
#' The output of this function is suited for submission to \url{https://www.ices.dk/data/data-portals/Pages/DATRAS.aspx}.
534534
#'
535535
#' @details
536-
#' The ICESDatras CSV format is one string matrix containing all tables of \code{\link{ICESDatrasData}}, where column names are included as header rows.
536+
#' The ICESDatras CSV format is a stack of comma separated tables containing all tables of \code{\link{ICESDatrasData}}, where column names are included as header rows. The file format does not contain the same number of elements in all rows, as the different tables are not padded with columns to produce a regular table. For this reason the output of \code{\link{WriteICESDatras}} is a character vector of comma separated strings representing the rows of the \code{\link{ICESDatrasData}}. The resulting output file written by RstoxFramework can for this reason not be read easily by e.g. \code{\link[data.table]{fread}}.
537537
#'
538538
#' @seealso \code{\link{DataTypes}} for a list of all StoX data types produced by \code{\link{RstoxData}}
539539
#'
@@ -549,7 +549,7 @@ NULL
549549
#' The output of this function is suited for submission to \url{https://www.ices.dk/data/data-portals/Pages/Stomach-content.aspx}.
550550
#'
551551
#' @details
552-
#' The ICESDatras CSV format is one string matrix containing all tables of \code{\link{ICESDatsuscData}}, where column names are included as header rows.
552+
#' The ICESDatsusc CSV format is a stack of comma separated tables containing all tables of \code{\link{ICESDatsuscData}}, where column names are included as header rows. The file format does not contain the same number of elements in all rows, as the different tables are not padded with columns to produce a regular table. For this reason the output of \code{\link{WriteICESDatsusc}} is a character vector of comma separated strings representing the rows of the \code{\link{ICESDatsuscData}}. The resulting output file written by RstoxFramework can for this reason not be read easily by e.g. \code{\link[data.table]{fread}}.
553553
#'
554554
#' @seealso \code{\link{DataTypes}} for a list of all StoX data types produced by \code{\link{RstoxData}}
555555
#'

man/WriteICESAcousticData.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/WriteICESBioticData.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/WriteICESDatrasData.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/WriteICESDatsuscData.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)