ReplaceDimList: ReplaceDimList

View source: R/easySdcTableGauss.R

ReplaceDimListR Documentation

ReplaceDimList

Description

Replace list elements of sdcTable coded hierarchies. Replacement elements can be sdcTable coded or TauArgus coded.

Usage

ReplaceDimList(dimList, replaceList, total = "Total")

Arguments

dimList

Named list of data frames (sdcTable coded)

replaceList

Named list where elements are data frames (sdcTable coded) or character vectors (TauArgus coded)

total

String used to name totals when TauArgus coded input

Value

Updated dimList where some or all elements are replaced

Examples

# First generate dimLists
dimListA <- FindDimLists(SSBtoolsData("sprt_emp_withEU")[, c("geo", "eu", "age")])
dimListB <- FindDimLists(SSBtoolsData("sprt_emp_withEU")[, c("geo", "age")])
dimListC <- FindDimLists(SSBtoolsData("sprt_emp_withEU")[, c("geo", "eu")])

# dimListA1 and dimListA are identical
dimListA1 <- ReplaceDimList(dimListB, dimListC)
identical(dimListA, dimListA1)

# replaceList can be TauArgus coded
hcrC <- DimList2Hrc(dimListC)

# dimListA2 and dimListA are identical
dimListA2 <- ReplaceDimList(dimListB, hcrC)
identical(dimListA, dimListA2)

# Also possible when duplicated names
ReplaceDimList(FindDimLists(EasyData("z3")[, -7]), 
               FindDimLists(EasyData("z2")[, -5]))

statisticsnorway/Kostra documentation built on Nov. 2, 2024, 6:40 p.m.