library(raster)
## Loading required package: sp
setwd("/home/michael/Dropbox/BGU/Din_Danino/v_07_flow_length_index/")
# Functions
source("code_01_function1.R")
# Sample data
elev = rbind(
c(8, 8, 8, 8, 9, 8, 9),
c(7, 7, 7, 7, 9, 7, 7),
c(6, 6, 6, 6, 6, 5, 7),
c(4, 5, 5, 3, 5, 4, 7),
c(4, 5, 4, 5, 4, 6, 5),
c(3, 3, 3, 3, 2, 3, 3),
c(2, 2, 2, 3, 4, 1, 3)
)
veg = rbind(
c(T, T, T, T, F, F, T),
c(T, T, T, T, T, F, F),
c(F, F, F, F, F, F, F),
c(F, T, F, F, F, F, T),
c(T, T, F, F, F, F, F),
c(T, T, T, F, F, F, F),
c(F, T, T, F, F, T, T)
)
# Plot
plotMatrix(elev, "Elevation")

plotMatrix(veg, "Vegetation")

# Test
f = flowlength(elev, veg)
# Plot
plotMatrix(f, "Flowlength")
