weighted_score {JDCruncheR}R Documentation

Weighted score calculation

Description

Function to weight a pre-calculated score

Usage

weighted_score(x, pond = 1)

Arguments

x

a QR_matrix or mQR_matrix object

pond

the weights to use. Can be an integer, a vector of integers, the name of one of the quality report variables or a list of weights for the mQR_matrix objects.

Value

the input with an additionnal weighted score

See Also

Traduction française

Other QR_matrix functions: export_xlsx(), export_xlsx.QR_matrix(), export_xlsx.mQR_matrix(), extract_QR(), rbind.QR_matrix(), sort()

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
QR <- compute_score(QR, n_contrib_score = 2)

# Weighted score
QR <- weighted_score(QR, 2)
print(QR)

# Extract the weighted score
QR$modalities$score_pond


[Package JDCruncheR version 0.2.4 Index]