# Load example data
data(leather)
# Create intermediate object (class 'decompr')
decompr_object <- load_tables_vectors(leather)
# Perform the WWZ decomposition
WWZ <- wwz(decompr_object)
# Obtain a disaggregated KWW decomposition
KWW <- wwz2kww(WWZ)
# Aggregate KWW
wwz2kww(WWZ, aggregate = TRUE)
# Same as running KWW directly, but the former is more efficient
# if we already have the WWZ
kww(decompr_object)
Run the code above in your browser using DataLab