replace "i"s with the correct data table number and attribute number, replace "percent" with whatever the standard unit should be
first line of code adds the standard unit, second gets rid of the custom unit
if you want to find all of the positions of a certain custom unit that should be standard, try this code (this is an example to find all "percent" units -- change to whatever you are looking for):
ls <- purrr::map(doc$dataset$dataTable[[i]]$attributeList$attribute, ~str_detect(.x$measurementScale$ratio$unit$customUnit, "percent"))
which(ls == TRUE)
replace "i"s with the correct data table number and attribute number, replace "percent" with whatever the standard unit should be first line of code adds the standard unit, second gets rid of the custom unit
if you want to find all of the positions of a certain custom unit that should be standard, try this code (this is an example to find all "percent" units -- change to whatever you are looking for):