Skip to contents

Function to combine multiple QR_matrix objects: line by line, both for the modalities and the values table.

Usage

# S3 method for class 'QR_matrix'
rbind(..., check_formula = TRUE)

Arguments

...

QR_matrix objects to combine.

check_formula

logical indicating whether to check the score formulas' coherency. By default, check_formula = TRUE: an error is returned if the scores were calculated with different formulas. If check_formula = FALSE, no check is performed and the score_formula of the output is NULL.

Value

rbind.QR_matrix() returns a QR_matrix object.

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 differents scores
QR1 <- compute_score(QR, score_pond = c(m7 = 2, q = 3, qs_residual_sa_on_sa = 5))
QR2 <- compute_score(QR, score_pond = c(m7 = 2, qs_residual_sa_on_sa = 5))

# Merge two quality report
try(rbind(QR1, QR2)) # Une erreur est renvoyée
#> Error in rbind(deparse.level, ...) : 
#>   All QR_matrices must have the same score formulas
rbind(QR1, QR2, check_formula = FALSE)
#> The quality report matrix has 26 observations
#> There are 19 indicators in the modalities matrix and 21 indicators in the values matrix
#> 
#> The quality report matrix contains the following variables:
#> series  qs_residual_sa_on_sa  f_residual_sa_on_sa  qs_residual_sa_on_i  f_residual_sa_on_i  f_residual_td_on_sa  f_residual_td_on_i  residuals_independency  residuals_normality  residuals_homoskedasticity  residuals_skewness  residuals_kurtosis  oos_mean  oos_mse  m7  q  q_m2  pct_outliers  frequency  arima_model  score
#> 
#> The variables exclusively found in the values matrix are:
#> frequency  arima_model
#> 
#> The smallest score is 0 and the greatest is 30
#> The average score is 11 and its standard deviation is 10.8995