report: Report Files Successfully Imported

Description Usage Arguments Value Print Method Note See Also Examples

View source: R/report.R

Description

Show a summary report after importing and quality checking a directory of STAR templates.

Usage

1
report(cluster, cluster.ok, qc.vector)

Arguments

cluster

a list of STAR objects, including ones that resulted in import "try-error".

cluster.ok

a list of STAR objects that have been selected and prepared for final import into the STAR database.

qc.vector

a logical vector, output from qc.

Value

Nested list with top elements Count and Filenames.

Print Method

When displaying a report object, error messages from filenames that failed to import are truncated to 23 characters by default. This makes the report easy to read from the console. To show full error messages, pass a large value of nchar to the print method:

1
2
rep <- report(cluster, cluster.ok, qc.vector)
print(rep, nchar=999)

Note

The full set of Excel templates included in the report consists of all the STAR objects in cluster. They can be divided into three categories:

The report also includes a count of files that had errors detected by the qc suite of quality checks. The QC issues are independent of whether read.template was able to import or not. The purpose of the QC is to raise a flag where stock assessors may have made a mistake when submitting their STAR templates.

In addition to file counts, the report also includes the specific filenames that had errors, were removed, or had QC issues. This list is useful for STAR administrators to bring into focus any STAR templates that were not successfully imported.

See Also

write.report writes a report object to a text file.

import.many.templates imports many Excel STAR templates from a directory into a cluster (list).

qc runs all QC tests on an Excel STAR template or a directory containing Excel STAR templates.

gfcmSTAR-package gives an overview of the package.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 

# Directory names
uploads <- "~/StockAssessmentResults/uploads/2021"
star.dir <- file.path(uploads, "WGSASP_General")
prop.file <- file.path(uploads, "properties/WGSASP_General.xlsx")

# Import
prop <- read.properties(prop.file)
cluster <- import.many.templates(star.dir, prop=prop)

# Select valid STAR objects to import into STAR database
cluster.ok <- cluster[sapply(cluster, class) != "try-error"]
cluster.ok$"star_template.xlsx" <- NULL

# Quality check
qc.vector <- qc(star.dir)

# Report
report(cluster, cluster.ok, qc.vector)

## End(Not run)

gfcm/gfcmSTAR documentation built on Feb. 5, 2022, 2:14 p.m.