R/north_south.R

#' north_south
#'
#' This function sets the top row of raster to '2' (i.e. the target) and the bottom row of the raster to '1' (i.e. the source)
#' @param raster Raster file of your study extent
#' @keywords Condatis, raster
#' @export
#' @import raster
#' @examples
#' r <- raster::raster(nrow=10, ncol=10)
#' north_south(r)

north_south<-function(raster){

  x<-raster
  x[]<-NA
  x[1,] <- 1
  x[nrow(x),]<-2
 
  return(x)


}
simon-tarr/condRtis documentation built on June 8, 2019, 3:46 a.m.