knitr::opts_chunk$set(echo = TRUE)

Show me the code

To evaluate the soil characteristics of the land units of Marinduque, Philippines, for farming banana, use the suit function as follows:

library(ALUES)
suit_banana <- suit("banana", terrain=MarinduqueLT)
head(suit_banana[["soil"]]$`Suitability Score`)
head(suit_banana[["soil"]]$`Suitability Class`)

To compute the overall suitability of the land units by averaging across factors, use the overall_suit function as follows:

osuit <- overall_suit(suit_banana[["soil"]], method="average")
head(osuit)

Show me the speed

We've recorded below the elapsed time for computing the suitability scores and classes for the land units of Marinduque, which has 881 units (or observations) in total; and, for the region of Lao Cai, Vietnam, which has 2928 land units.

library(microbenchmark)
microbenchmark(
  suppressWarnings(suit("banana", terrain=MarinduqueLT, interval="unbias"))
)
microbenchmark(
  suppressWarnings(suit("banana", terrain=LaoCaiLT, interval="unbias"))
)


alstat/ALUES documentation built on June 17, 2022, 10:42 p.m.