Function to find out whether a vector consists of strings in the format "yXXXX" or "XXXX" with X being a number
See also
Other ObjectInfo:
dimExists(),
fulldim(),
hasCoords(),
hasSets(),
is.temporal(),
ncells(),
ndim(),
sameDims()
Examples
x <- c("1955", "y1853", "12a4")
isYear(x, with_y = TRUE)
#> [1] FALSE TRUE FALSE
isYear(x, with_y = FALSE)
#> [1] TRUE FALSE FALSE