Type: Package
Title: A Computer Program for Geotechnical Investigations
Version: 0.1.0
Description: The 'geomod' does spatial prediction of the Geotechnical soil properties. It predicts the spatial distribution of Geotechnical properties of soil e.g. shear strength, permeability, plasticity index, Standard Penetration Test (SPT) counts, etc. The output of the prediction takes the form of a map or a series of maps. It uses the interpolation technique where a single or statistically “best” estimate of spatial occurrence soil property is determined. The interpolation is based on both the sampled data and a variogram model for the spatial correlation of the sampled data. The single estimate is produced by a Kriging technique.
License: GPL-3
Encoding: UTF-8
LazyData: true
Depends: R (≥ 3.5.0)
Imports: raster, sp, caret, rasterVis, stats, randomForest, arm, kernlab, e1071, Cubist, rpart, ranger, qrnn, quantregForest, nnet
RoxygenNote: 7.1.2
NeedsCompilation: no
Packaged: 2023-05-05 07:46:47 UTC; user
Author: Festus Ngeno [aut, cre]
Maintainer: Festus Ngeno <festus.k.ngeno@gmail.com>
Repository: CRAN
Date/Publication: 2023-05-05 20:50:02 UTC

Function to develop spatial map of Geotechnical soil properties

Description

This functions is used to estimate spatial maps of Geotechnical soil properties using machine learning technique

Usage

predGeo(indata,fgrid, k, z, model="rf")

Arguments

indata

one column input spatial dataframe containing the target soil variable or its transformation

fgrid

Input grid or raster stack containing predictors set for the target soil variable

k

Set limit for number of simulations for the spatial modelling algorithm

z

Confidence interval level in percent (for example 95)

model

The model for predicting target soil variable using the predictors (for example linear)

Details

One-variable input dataframe is prefered or at least the first column should have the target Geotechnical variable to predict. It should not contain NAs. The number of realizations k need not be too high because the software multiplies it exponentially and may slow down the computing process if set to a high value. For example k=5 will results into more than 40 realizations created

Value

a raster map of prediction for the target Geotechnical property

Note

The input dataframe and predictors need to have similar coordinate reference system (CRS). In addition, the input dataframe should not have missing entrie (NAs)

Author(s)

Festus K. Ngeno and Christian Omuto

See Also

regmodelSuit

Examples

library(caret)
library(sp)
library(rasterVis)
library(raster)
library(randomForest)
data(predLayer)
data(sampleData)
soils=subset(sampleData,!is.na(sampleData$LL))
dattu=sampleData[,c("LL")]

  Tesrd=predGeo(dattu,predLayer,k=3,90,"lm")


Sample grid stack map of nutrient indicators for crop fertility requirements

Description

A grid stack map of nine variables for assessing crop suitabilities

Usage

data("predLayer")

Format

The format is: Formal class 'SpatialGridDataFrame' [package "sp"] with 4 slots ..@ data :'data.frame': 16900 obs. of 3 variables: .. ..$ depthcodes: num [1:16900] 3 1 3 3 3 3 3 3 1 1 ... .. ..$ texture : int [1:16900] 5 5 5 5 5 5 5 5 11 11 ... .. ..$ dem : num [1:16900] 489 489 489 485 487 ... ..@ grid :Formal class 'GridTopology' [package "sp"] with 3 slots .. .. ..@ cellcentre.offset: Named num [1:2] 383216 3341506 .. .. .. ..- attr(*, "names")= chr [1:2] "x" "y" .. .. ..@ cellsize : num [1:2] 357 357 .. .. ..@ cells.dim : int [1:2] 130 130 ..@ bbox : num [1:2, 1:2] 383038 3341327 429478 3387767 .. ..- attr(*, "dimnames")=List of 2 .. .. ..$ : chr [1:2] "x" "y" .. .. ..$ : chr [1:2] "min" "max" ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slot .. .. ..@ projargs: chr "+proj=utm +zone=41 +datum=WGS84 +units=m +no_defs"

Examples

data(predLayer)
summary(predLayer$depthcodes)
hist(predLayer$dem)

A function for guiding selection of a predition model for modelling soil properties

Description

This function evaluates suitability of most predition models in mapping soil properties using a set of predLayer

Usage

regmodelSuit(df, ...)

Arguments

df

a dataframe of target soil property and its predLayer

...

name of the target soil variable to predict and names of its predLayer

Details

The name of the target soil variable to predict and names of its predLayer are seperated by commas and are similar to column names of the corresponding variables in the supplied dataframe. The name of the target soil variable starts the list and followed by the names of its predLayer. For example, if the dataframe has EC, landcover,DEM, Slope, NDVI, etc., then the input could be (soil,EC,landcover,Slope,DEM).

Value

A table of model statistics such as root mean square error (RMSE), mean absolute error (MAE), r-squared (R2) and Nash-Sutcliffe coefficient of efficiency (NSE) for the popular models in digital soil mapping

Note

The function carries 5-fold cross-validation. Sometimes it may give a warning of missing resample performance with some models. It's important to ensure no NA in the data used for modelling

References

Nash, J. E.; Sutcliffe, J. V. 1970. River flow forecasting through conceptual models part I — A discussion of principles. Journal of Hydrology. 10 (3): 282–290

Examples

library(caret)
library(sp)
data(sampleData)
soil1=sampleData[,c("LL")]
soil1=subset(soil1,!is.na(soil1$LL))
overlay.ov=over(soil1, predLayer)
soil1$dem=overlay.ov$dem
soil1$texture=overlay.ov$texture
soil1$depthcodes=overlay.ov$depthcodes
soil2=soil1@data[,c("LL","dem","texture","depthcodes")]

regmodelSuit(soil2,LL,dem,texture,depthcodes)


Sample soil dataset from a Geotechnical investigation

Description

Pit sample dataset from a Geotechnical investigation

Usage

data("sampleData")

Format

The format is: Formal class 'SpatialPointsDataFrame' [package "sp"] with 5 slots ..@ data :'data.frame': 152 obs. of 4 variables: .. ..$ Density : num [1:152] 0.36 0.465 0.39 0.36 0.42 0.87 0.075 0.375 0.84 0.33 ... .. ..$ Resistance: num [1:152] 0.8 2.58 0.98 0.532 1.87 18.5 0.43 0.302 0.345 2.7 ... .. ..$ LL : num [1:152] 8.6 8.37 8.31 8.76 7.81 ... ..@ coords.nrs : num(0) ..@ coords : num [1:152, 1:2] 420924 418226 418226 415334 415334 ... .. ..- attr(*, "dimnames")=List of 2 .. .. ..$ : NULL .. .. ..$ : chr [1:2] "coords.x1" "coords.x2" ..@ bbox : num [1:2, 1:2] 386582 3343117 427796 3386711 .. ..- attr(*, "dimnames")=List of 2 .. .. ..$ : chr [1:2] "coords.x1" "coords.x2" .. .. ..$ : chr [1:2] "min" "max" ..@ proj4string:Formal class 'CRS' [package "sp"] with 1 slot .. .. ..@ projargs: chr "+proj=utm +zone=41 +datum=WGS84 +units=m +no_defs"

Details

A dataset with 152 points of soil horizons for mapping Geotechnical soil properties

Examples

data(sampleData)
str(sampleData)