Learn R Programming

easySdcTable (version 1.0.7)

ReplaceDimList: ReplaceDimList

Description

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

Usage

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

Value

Updated dimList where some or all elements are replaced

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

Examples

Run this code
# 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]))

Run the code above in your browser using DataLab