Skip to contents

To export a quality report in an Excel file.

Usage

# S3 method for class 'QR_matrix'
write(x, file, auto_format = TRUE, overwrite = TRUE, ...)

Arguments

x

a QR_matrix object.

file

a character object with the path to the file to export

auto_format

logical indicating whether to format the output (auto_format = TRUE by default).

overwrite

logical indicating whether to create an Excel file if it doesn't exist yet (overwrite = TRUE by default)

...

other unused arguments

Value

Returns invisibly (via invisible()) a workbook object created by openxlsx::loadWorkbook() for further manipulation.

Examples

# Path leading to a demetra_m matrix
demetra_path <- file.path(
    system.file("extdata", package = "JDCruncheR"),
    "WS/WS_world/Output/SAProcessing-1",
    "demetra_m.csv"
)

# Extract the quality report from the demetra_m file
QR <- extract_QR(demetra_path)
#> Multiple column found for extraction of diagnostics.seas-i-qs:2, diagnostics.seas-i-qs
#> Last column selected
#> Multiple column found for extraction of diagnostics.seas-i-f:2, diagnostics.seas-i-f
#> Last column selected

# Export the Quality Report to an Excel file
write(x = QR, file = tempfile(fileext = ".xlsx"))