extract_score {JDCruncheR}R Documentation

Score extraction

Description

To extract score variables from QR_matrix or mQR_matrix objects.

Usage

extract_score(
  x,
  format_output = c("data.frame", "vector"),
  weighted_score = FALSE
)

Arguments

x

a QR_matrix or mQR_matrix.

format_output

string of characters indicating the output format: either a data.frame or a vector.

weighted_score

logical indicating whether to extract the weighted score (if previously calculated) or the unweighted one. By default, the unweighted score is extracted.

Details

For QR_matrix objects, the output is a vector or the object NULL if no score was previously calculated. For mQR_matrix objects, it is a list of scores (NULL elements or vectors).

Value

extract_score() returns a data.frame with two column: the series name and their score.

See Also

Traduction française

Examples

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

# Extract the quality report from the demetra_m file
QR <- extract_QR(demetra_path)

# Compute the score
QR1 <- compute_score(QR, n_contrib_score = 2)
mQR <- mQR_matrix(QR, compute_score(QR))

# Extract score
extract_score(QR1)
extract_score(mQR)


[Package JDCruncheR version 0.2.4 Index]