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.
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")
For a summary of the package:
library(icesDatsuQC) ?icesDatsuQC
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")
ICES Data Screening Utility (DATSU): https://datsu.ices.dk
ICES Data Screening Utility web services: https://datsu.ices.dk/web/webservices.aspx
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.