Skip to content

Handling of single digit numeric codes #23

@raphbub-vs

Description

@raphbub-vs

In the automatic detection, if codes do not contain any alphabetic character they are detected based on their length (or max length when there are many) when converted to character.

As division are made up of two digits code, the ones before 10 are prefixed with a zero when written as character. So if we recode only divisions before 10, stored as numeric (c(1,2,3)) we would get a detected level of section and then those would be recoded to NAs as codes aren't corresponding to any section letter.

library(noga)
automaticleveldetection(c(1:9), "en")
#> Detected level is : section
#> [1] "section"

noga_recode(c(1:9), "en")
#> The following values in the supplied variable could not be recoded and has been set to `NA` as there was no according NOGA-level match: 1,2,3,4,5,6,7,8,9
#> [1] NA NA NA NA NA NA NA NA NA

I would prefer this to either be automatically prefixed in the recoding phase (with a warning) or failing in the automatic detection stage. What do you think ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions