R/south_north.R

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

south_north<-function(raster){

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

  return(x)


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