R/is.temporal.R

Defines functions is.temporal

Documented in is.temporal

#' is.temporal, is.spatial
#' 
#' Functions to find out whether a vector consists of strings consistent with
#' the definition for auto-detection of temporal or spatial data.
#' 
#' 
#' @aliases is.temporal is.spatial
#' @param x A vector
#' @return Returns TRUE or FALSE
#' @author Jan Philipp Dietrich
#' @examples
#' 
#' is.temporal(1991:1993)
#' is.spatial(c("GLO","AFR"))
#' 
#' @export
is.temporal <- function(x) {
  return(length(grep("^[a-z]?[0-9]{4}$",x))==length(x))
}

Try the magclass package in your browser

Any scripts or data that you put into this service are public.

magclass documentation built on July 9, 2023, 7:03 p.m.