ropensci / EML

Ecological Metadata Language interface for R: synthesis and integration of heterogenous data
https://docs.ropensci.org/EML
Other
98 stars 33 forks source link

support for multiple missing value codes in set_attributes #269

Closed jeanetteclark closed 5 years ago

jeanetteclark commented 5 years ago

per issue #268, this adds a missingValue argument to set_attributes, allowing users to set multiple missing value codes on a single attribute easily.

I opted to generalize the set_enumeratedDomain and check_factors functions to work with either missing value codes or factors since the input to both functions is a data.frame with columns attributeName code definition

The function will warn you if you set a missingValue on the same attribute in both the attributes data.frame and the missingValues data.frame

mbjones commented 5 years ago

I looked this over and it looks good for me. I tested it briefly locally, all tests pass. I also ran some ad-hoc code to test the feature and it now does support multiple missing code values. It looks like the feature is not fully exercised in the tests, in that successfully setting the missing value code is not checked to be correct in the resulting EML. But I think given the other testing it is reasonable as is. I'd recommend going ahead and merging.

cboettig commented 5 years ago

Thanks! Impressive work @jeanetteclark and team in discussing #269 and developing this solution so quickly.