ReadEBXHierarchy: Read a complete group hierarchy

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/util_ReadEBXHierarchy.R

Description

Is used by ReadDatasetCodelists.

Usage

1
ReadEBXHierarchy(sdmx_level1_ID, sdmx_level2_ID)

Arguments

sdmx_level1

ID upper level of a hierarchy, as returned by GetDimensionGroups$EBXCodelist

sdmx_level2

lower level of a hierarchy, as returned by GetDimensions$EBXCodelist

Details

This function calls GetGroupConnections to find possible grouping solutions accross multiple levels. For each of these levels if reads the ReadEBXGroup grouping, combining all levels to a final result. In case there are multiple group solutions reported by GetGroupConnections, each solution is combined and the groupings for each solution are merged into the final result.

Value

grouping as a data.table with two columns(parent,child)

Author(s)

Thomas Berger, thomas.berger@fao.org

See Also

GetDimensionGroups and GetDatasetDimensions.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
library(faoebx5)
library(fishstatr)
ReadMetadata()
result <- ReadEBXHierarchy(306,301)
[1] "  parentID=306, childID=307, sdmxGroupName=HCL_FI_SPECIES_MAJOR_ORDER"
[1] "  parentID=307, childID=302, sdmxGroupName=HCL_FI_SPECIES_ORDER_FAMILY"
[1] "  parentID=302, childID=301, sdmxGroupName=HCL_FI_SPECIES_FAMILY_ITEM"
[1] "  parentID=306, childID=307, sdmxGroupName=HCL_FI_SPECIES_MAJOR_ORDER"
[1] "  parentID=307, childID=301, sdmxGroupName=HCL_FI_SPECIES_ORDER_ITEM"
nrow(result)
[1] 12751

## End(Not run)

bergertom/fishstatr documentation built on Dec. 4, 2019, 2:08 p.m.