predict.ptf: Run pedotransfer functions

View source: R/predict.ptf.R

predict.ptfR Documentation

Run pedotransfer functions

Description

Wrapper for running any of the European hydraulic PTFs based on the European HYdropedological Data Inventory enclosed in package euptf.

Usage

predict.ptf(newdata, ptf, h = NULL, ...)

Arguments

newdata

Data frame containing the values at which predictions are required. The predictors referred to in ptf must be present by name in newdata. To get the correct names, follow example: data(ptf.data)

ptf

Name of PTF to be run, as a character. Any of ("PTF01","PTF02",...,"PTF15").

h

Optional vector of suction head value(s) at which the (Mualem-)van Genuchten model must be evaluated.

...

Arguments to be passed to constitutive functions.

Value

For PTF01, PTF02, PTF03, PTF04, PTF05, PTF06, PTF07, PTF08, PTF09, PTF10, PTF11, PTF12, PTF13, PTF14, PTF15, PTF16, PTF17, predict.ptf returns a vector of length N, the number of observations in newdata.

For PTF18, PTF19, PTF20, PTF21, PTF22, the function returns a Nx4 or Nx7 matrix of (Mualem-)van Genuchten parameters, with N the number of rows in newdata. If h is given, then it returns a Mx4xN array, with M the length of h, N the number of rows in newdata. The second dimension of the array gives h, theta, Se and K (the outputs of function MV).

Warning

The pedotransfer functions in this package use the following units:

Length: centimeter
Time: day
Mass: gram

Author(s)

M. Weynants

References

Tóth Brigitta, Weynants Mélanie, Nemes Attila, Makó Andras, Bilas George and Tóth Gergely. 2014. New generation of hydraulic pedotransfer functions for Europe. European Journal of Soil Science. in Press.

See Also

ptf.data, ChoosePTF, MV

Examples

# load example data
data(ptf.data)
# set modified FAO texture class
ptf.data$TEXT_FAO_MOD <- psd2classFAO_MOD(ptf.data$USSAND,ptf.data$USSILT,ptf.data$USCLAY,ptf.data$OC,option=TRUE)
# set USDA texture class
ptf.data$TEXT_US <- psd2classUS(ptf.data$USSAND,ptf.data$USSILT,ptf.data$USCLAY,ptf.data$OC,option=TRUE)
# examples of usage of predict.ptf
ths_fao <- predict.ptf(ptf.data,"PTF01")
fc_usda <- predict.ptf(ptf.data,"PTF07")
wp_psd_OC <- predict.ptf(ptf.data,"PTF10")
ks_psd_ph_cec <- 10^(predict.ptf(ptf.data,"PTF17"))
ks_psd_oc <- 10^(predict.ptf(ptf.data,"PTF16"))

### Parameters estimation and evaluation of Mualem-van Genuchten model
# define a vector h of 24 suction head values
h <- c(0,10^(seq(0,4.5,by=0.2)))
## if only MRC is needed
# get van Genuchten parameters
vg_psd_oc_bd_ph <- predict.ptf(ptf.data,"PTF22")
# evaluate van Genuchten model at h
thk_psd_oc_bd_ph1 <- predict.ptf(ptf.data,"PTF22",h)
## if both MRC and HCC are needed
# get Mualem-van Genuchten parameters
mv_psd_oc_bd_ph <- predict.ptf(ptf.data,"PTF19")
# evaluate Mualem-van Genuchten model at h
thk_psd_oc_bd_ph2 <- predict.ptf(ptf.data,"PTF19",h)
## compare obtained MRC for the PTF22 and PTF19
plot(thk_psd_oc_bd_ph1[,2,],thk_psd_oc_bd_ph2[,2,],xlab="MRC predicted with PTF22",ylab="MRC predicted with PTF19")
abline(0,1,col="grey")
# The two PTFs produce different results: when only retention data are needed, PTF15 is recommended, but if conductivity data are also required, PTF02 should be use.

## example to save predicted values to xlsx file:
require("xlsx")
# if not already installed
## NOT RUN
# install.packages("xlsx")
# require("xlsx")
# write.xlsx(x = mv_psd_oc_bd_ph, file = "pred_MVG.xlsx", sheetName = "pred_MVG", row.names = FALSE)
##

melwey/euptf documentation built on Sept. 17, 2022, 3:35 a.m.