sort {JDCruncheR} | R Documentation |
QR_matrix and mQR_matrix sorting
Description
To sort the quality reports on one or several variables
Usage
## S3 method for class 'QR_matrix'
sort(x, decreasing = FALSE, sort_variables = "score", ...)
## S3 method for class 'mQR_matrix'
sort(x, decreasing = FALSE, sort_variables = "score", ...)
Arguments
x |
a |
decreasing |
logical indicating whether the quality reports must be sorted in ascending or decreasing order. By default, the sorting is done in ascending order. |
sort_variables |
They must be present in the modalities table. |
... |
other parameters of the function |
Value
the input with sorted quality reports
See Also
Other QR_matrix functions:
export_xlsx()
,
export_xlsx.QR_matrix()
,
export_xlsx.mQR_matrix()
,
extract_QR()
,
rbind.QR_matrix()
,
weighted_score()
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)
print(QR$modalities$score)
# Sort the scores
QR <- sort(QR, sort_variables = "score") # Pour trier par ordre croissant sur le score
print(QR$modalities$score)
[Package JDCruncheR version 0.2.4 Index]