R/contain.R

Defines functions contain

Documented in contain

#' contain
#'
#' contain
#' @param a spatial object
#' @param b spatial object
#' @param REVERSE boolean i.e not containing
#' @keywords spatialManip
#' @export
#' @examples
#' \dontrun{
#' contain()
#' }
contain <- function(a,b,REVERSE=FALSE){
  indice <- sp::over(a,b,returnList = TRUE)
  tmp <- seq(1,length(b))
  if (REVERSE) {
    res <- tmp[-unlist(indice)]
  } else {
    res <- tmp[unlist(indice)]
  }
  return(res)
}
jeanmarielepioufle/spatialManip documentation built on July 7, 2017, 1:25 a.m.