Skip to content

Commit de82bbe

Browse files
committed
Improve parsing of labeled values in codInstr tags; fixes #94
1 parent 834c48d commit de82bbe

File tree

5 files changed

+4962
-2
lines changed

5 files changed

+4962
-2
lines changed

NEWS.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# ipumsr (development version)
22

3+
* Improved parsing of labeled values included in "codInstr" tags in the DDI
4+
codebook for microdata extracts.
5+
36
# ipumsr 0.9.0
47

58
## New features

R/ddi_read.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -781,8 +781,8 @@ get_var_info_from_ddi <- function(ddi_xml,
781781

782782
code_instr <- fostr_replace(
783783
xml_text_from_path_first(var_info_xml, "d1:codInstr"),
784-
"^Codes",
785-
""
784+
"^Codes|(\n)Codes([[:digit:]])",
785+
"\\1\\2"
786786
)
787787

788788
if (file_type == "hierarchical") {

0 commit comments

Comments
 (0)