Mark-Eis / BitsnBobs

For General Bits and Bobs of Code
https://mark-eis.github.io/BitsnBobs/
Other
1 stars 0 forks source link

In `validate_degminsec()`. check `.latorlon` attribute value #37

Closed Mark-Eis closed 6 months ago

Mark-Eis commented 6 months ago

https://github.com/Mark-Eis/BitsnBobs/blob/c8d5c4dee51a135860e99e2f1c3838c1d091bbab/R/degreeconvert.R#L216C1-L216C19

if (!dms %@% ".latorlon" %in% c(NA, "lat", "lon")
if (!attr(dms, ".latorlon") %in% c(NA, "lat", "lon")
    stop(
        "Attribute `.latorlon` must be one of `NA`, `\"lat\"`, `\"lon\"`",
        call. = FALSE
    )    
Mark-Eis commented 6 months ago

Also check: –

if (!is.logical(dms %@% "negative"))
    stop(
        "Attribute `\"negative\"` must be of type `logical`",
        call. = FALSE
    )    
Mark-Eis commented 6 months ago

3f3b37a