# no children of CP01 present in id:
child(id="CP01", usedict=FALSE)
# still no direct child present:
child(id=c("CP01","CP0111"), usedict=FALSE, closest=FALSE, k=1)
# but a grandchild of CP01 is found:
child(id=c("CP01","CP0111"), usedict=FALSE, closest=TRUE)
# now, get the children directly from the code dictionary:
child(id=c("CP01","CP0111"), usedict=TRUE)
# which works analogously for parents:
parent(id=c("CP01","CP0111"), usedict=TRUE)
Run the code above in your browser using DataLab