Project Status r-universe name version number branch version number GitHub release License-blue.svg)

CRAN status: CRAN_Status_Badge CRAN RStudio mirror downloads CRAN RStudio mirror downloads

ICES Logo

icesDatsuQC

Run quality checks on data sets using the same checks that are conducted on the ICES Data Submission Utility (DATSU).

icesDatsuQC is implemented as an R package and is currently hosted on r-universe and available on CRAN.

Installation

The stable version of icesDatsuQC can be installed from CRAN using the install.packages command:

install.packages("icesDatsuQC", repos = "https://cloud.r-project.org")

or a potentially more recent, but less stable version installed from r-universe:

install.packages("icesDatsuQC", repos = "https://ices-tools-prod.r-universe.dev")

Usage

For a summary of the package:

library(icesDatsuQC)
?icesDatsuQC

Examples

Test a VMS data file

A sample data file is included with the icesDatsu package called vms_test.csv

library(icesDatsuQC)
filename <- system.file("test_files/vms_test.csv", package = "icesDatsuQC")
vms_test <- read.csv(filename, header = FALSE)
head(vms_test)

Lets say we have used the icesDatsu package to find the correct dataset version ID and record ID, that is, we know we want dataset 145 (VMS) and record type VE (VMS records).

Then to run the SQL checks on our file, run:

runQCChecks(filename, 145, "VE")

So all checks passed. Great, what is it like if there is an error? Lets force an error

# invalid year
vms_test[1:2, 3] <- 1999
# invalid month
vms_test[3, 4] <- 13
# invalid discinct vessel count
vms_test[3, 5] <- 0
# invalid country code - only one country per file MISSED
vms_test[3, 2] <- "NO"
write.table(vms_test, file = "vms_test2.csv", row.names = FALSE, col.names = FALSE, sep = ",")
runQCChecks("vms_test2.csv", 145, "VE")

References

ICES Data Screening Utility (DATSU): https://datsu.ices.dk

ICES Data Screening Utility web services: https://datsu.ices.dk/web/webservices.aspx

Development

icesDatsuQC is developed openly on GitHub.

Feel free to open an issue there if you encounter problems or have suggestions for future versions.

The current development version can be installed using:

library(devtools)
install_github("ices-tools-prod/icesDatsuQC@development")


ices-tools-prod/icesDatsuQC documentation built on Oct. 27, 2024, 5 a.m.