View source: R/set_eurostat_toc.R
toc_determine_hierarchy | R Documentation |
Divides the number of spaces before alphanumeric characters with 4 and uses the result to determine hierarchy. Top level is 0.
toc_determine_hierarchy(input_string)
input_string |
A string containing Eurostat TOC titles |
Used in toc_determine_hierarchy function to determine hierarchy. Hierarchy is defined in Eurostat .txt format TOC files by the number of white space characters at intervals of four. For example, " Foo" (4 white space characters) is one level higher than " Bar" (8 white space characters). "Database by themes" (0 white space characters before the first alphanumeric character) is highest in the hierarchy.
The function will return a warning if the input has white space in anything else than as increments of 4. 0, 4, 8... are acceptable but 3, 6, 10... are not.
Numeric
Pyry Kantanen
get_eurostat_toc()
toc_count_children()
toc_determine_hierarchy()
toc_list_children()
toc_count_whitespace()
strings <- c(" abc", " cdf", "no_spaces")
eurostat:::toc_determine_hierarchy(strings)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.