Skip to content

get_datras_unaggregated_data("CA", ...) issue #50

@einarhjorleifsson

Description

@einarhjorleifsson

i have discussed this in a proprietary forum with @vaishav
just included for the record here:

# remotes::install_github("ices-tools-prod/icesDatras")
# first CA record returns all variables with either "" or NA
icesDatras::get_datras_unaggregated_data("CA", "NS-IBTS", 2025, 1) |> str()

first records when specifying recordtype "CA" in all cases for combo of (type-)survey-year-quarter returns as the first row either "" or NA. example:

> icesDatras::get_datras_unaggregated_data("CA", "NS-IBTS", 2025, 1) |> str()
Downloading DATRAS data...
Extracting files...
Reading data...
Classes ‘data.table’ and 'data.frame':	30807 obs. of  36 variables:
  $ RecordHeader        : chr  "" "CA" "CA" "CA" ...
$ Survey              : chr  "" "NS-IBTS" "NS-IBTS" "NS-IBTS" ...
$ Quarter             : int  NA 1 1 1 1 1 1 1 1 1 ...
$ Country             : chr  "" "DK" "DK" "DK" ...
$ Platform            : chr  "" "26D4" "26D4" "26D4" ...
$ Gear                : chr  "" "GOV" "GOV" "GOV" ...
$ SweepLength         : int  NA 60 60 60 60 60 60 60 60 60 ...
$ GearExceptions      : chr  "" "S" "S" "S" ...
$ DoorType            : chr  "" "P" "P" "P" ...
$ StationName         : chr  "" "1" "1" "1" ...
$ HaulNumber          : int  NA 1 1 1 1 1 1 1 1 1 ...
$ Year                : chr  "" "2025" "2025" "2025" ...
$ SpeciesCodeType     : chr  "" "W" "W" "W" ...
$ SpeciesCode         : chr  "" "126438" "126438" "126438" ...
$ AreaType            : chr  "" "0" "0" "0" ...
$ AreaCode            : chr  "" "44F9" "44F9" "44F9" ...
$ LengthCode          : chr  "" "." "." "." ...
$ LengthClass         : int  NA 130 140 160 180 200 210 220 240 240 ...
$ IndividualSex       : chr  "" "F" "F" "F" ...
$ IndividualMaturity  : chr  "" "A" "A" "Ba" ...
$ AgePlusGroup        : chr  "" "-9" "-9" "-9" ...
$ IndividualAge       : int  NA 1 1 1 1 2 2 1 2 2 ...
$ CANoAtLngt          : int  NA 1 1 1 1 1 1 1 1 1 ...
$ IndividualWeight    : num  NA 18 20 38 44 75 63 90 109 118 ...
$ FishID              : chr  "" "-9" "-9" "-9" ...
$ GeneticSamplingFlag : chr  "" "-9" "-9" "-9" ...
$ StomachSamplingFlag : chr  "" "-9" "-9" "-9" ...
$ AgeSource           : chr  "" "-9" "-9" "-9" ...
$ AgePreparationMethod: chr  "" "-9" "-9" "-9" ...
$ OtolithGrading      : chr  "" "-9" "-9" "-9" ...
$ ParasiteSamplingFlag: chr  "" "-9" "-9" "-9" ...
$ MaturityScale       : chr  "" "SMSF" "SMSF" "SMSF" ...
$ LiverWeight         : num  NA -9 -9 -9 -9 -9 -9 -9 -9 -9 ...
$ AphiaID             : int  NA 126438 126438 126438 126438 126438 126438 126438 126438 126438 ...
$ Species             : chr  "" "Merlangius merlangus" "Merlangius merlangus" "Merlangius merlangus" ...
$ DateofCalculation   : chr  "" "20251106" "20251106" "20251106" ...                                                                                                                                           Column name 'ValidAphiaID' (colClasses[[2]][7]) not found

possibly an API construct issue rather than downstream issue in the R-package.

bookkeeping

devtools::session_info()

─ Session info ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
setting  value
version  R version 4.4.1 (2024-06-14)
os       Debian GNU/Linux 11 (bullseye)
system   x86_64, linux-gnu
ui       RStudio
language (EN)
collate  is_IS.UTF-8
ctype    is_IS.UTF-8
tz       Atlantic/Reykjavik
date     2026-01-29
rstudio  2024.09.0+375 Cranberry Hibiscus (server)
pandoc   3.2 @ /usr/lib/rstudio-server/bin/quarto/bin/tools/x86_64/ (via rmarkdown)
quarto   1.5.57 @ /usr/local/bin/quarto

─ Packages ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
package     * version  date (UTC) lib source
cachem        1.1.0    2024-05-16 [1] CRAN (R 4.4.1)
cli           3.6.5    2025-04-23 [1] CRAN (R 4.4.1)
data.table    1.18.2.1 2026-01-27 [1] CRAN (R 4.4.1)
devtools      2.4.6    2025-10-03 [1] CRAN (R 4.4.1)
digest        0.6.39   2025-11-19 [1] CRAN (R 4.4.1)
ellipsis      0.3.2    2021-04-29 [1] CRAN (R 4.4.1)
evaluate      1.0.5    2025-08-27 [1] CRAN (R 4.4.1)
fastmap       1.2.0    2024-05-15 [1] CRAN (R 4.4.1)
fs            1.6.6    2025-04-12 [1] CRAN (R 4.4.1)
glue          1.8.0    2024-09-30 [1] CRAN (R 4.4.1)
htmltools     0.5.9    2025-12-04 [1] CRAN (R 4.4.1)
icesDatras    1.5.1    2026-01-29 [1] Github (ices-tools-prod/icesDatras@239f978)
knitr         1.51     2025-12-20 [1] CRAN (R 4.4.1)
lifecycle     1.0.5    2026-01-08 [1] CRAN (R 4.4.1)
magrittr      2.0.4    2025-09-12 [1] CRAN (R 4.4.1)
memoise       2.0.1    2021-11-26 [1] CRAN (R 4.4.1)
otel          0.2.0    2025-08-29 [1] CRAN (R 4.4.1)
pkgbuild      1.4.8    2025-05-26 [1] CRAN (R 4.4.1)
pkgload       1.4.1    2025-09-23 [1] CRAN (R 4.4.1)
purrr         1.2.1    2026-01-09 [1] CRAN (R 4.4.1)
R6            2.6.1    2025-02-15 [1] CRAN (R 4.4.1)
remotes       2.5.0    2024-03-17 [1] CRAN (R 4.4.1)
rlang         1.1.7    2026-01-09 [1] CRAN (R 4.4.1)
rmarkdown     2.30     2025-09-28 [1] CRAN (R 4.4.1)
rstudioapi    0.18.0   2026-01-16 [1] CRAN (R 4.4.1)
sessioninfo   1.2.3    2025-02-05 [1] CRAN (R 4.4.1)
usethis       3.2.1    2025-09-06 [1] CRAN (R 4.4.1)
vctrs         0.7.1    2026-01-23 [1] CRAN (R 4.4.1)
xfun          0.56     2026-01-18 [1] CRAN (R 4.4.1)
yaml          2.3.12   2025-12-10 [1] CRAN (R 4.4.1)

[1] /heima/einarhj/R/x86_64-pc-linux-gnu-library/4.4
[2] /usr/local/lib/R/site-library
[3] /usr/lib/R/site-library
[4] /usr/lib/R/library

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions