To evaluate the soil characteristics of the land units of Marinduque,
Philippines, for farming banana, use the suit function as
follows:
## Warning in suitability(terrain, crop_soil, mf = mf, sow_month = NULL, minimum =
## minimum, : maximum is set to 16 for factor CECc since all parameter intervals
## are equal.
## CFragm CECc pHH2O SoilTe
## 1 0.8533333 0.7500 0 0.96
## 2 0.8800000 0.7500 0 0.96
## 3 0.8666667 0.7500 0 0.96
## 4 0.8666667 0.7500 0 0.96
## 5 0.8400000 0.7500 0 0.96
## 6 0.8533333 0.8125 0 0.96
## CFragm CECc pHH2O SoilTe
## 1 S1 S1 N S1
## 2 S1 S1 N S1
## 3 S1 S1 N S1
## 4 S1 S1 N S1
## 5 S1 S1 N S1
## 6 S1 S1 N S1
To compute the overall suitability of the land units by averaging
across factors, use the overall_suit function as
follows:
## Score Class
## 1 0.6505051 S2
## 2 0.6569697 S2
## 3 0.6537374 S2
## 4 0.6537374 S2
## 5 0.6472727 S2
## 6 0.6656566 S2
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"))
)## Unit: milliseconds
## expr
## suppressWarnings(suit("banana", terrain = MarinduqueLT, interval = "unbias"))
## min lq mean median uq max neval
## 6.023907 6.084697 6.615003 6.120179 6.190099 11.57603 100
## Unit: milliseconds
## expr
## suppressWarnings(suit("banana", terrain = LaoCaiLT, interval = "unbias"))
## min lq mean median uq max neval
## 9.48987 9.628497 10.1796 9.723097 9.9503 17.05359 100