R/getProp.R

Defines functions getProp

# summary for each row (get proportion for each row of the landscape)
getProp <- function(x, nRow) {
 B <- sum(x == 1)/nRow
 T <- sum(x == 2)/nRow
 M <- sum(x == 3)/nRow
 R <- 1 - sum(B, T, M)
 return(setNames(c(B, T, M, R), c('B', 'T', 'M', 'R')))
}
willvieira/STManaged documentation built on Sept. 4, 2020, 2:26 p.m.