best_tr: Best Model Function

Description Usage Arguments Examples

View source: R/mainFun.R

Description

This function estimates coefficients for three different types of model.

Usage

1
best_tr(y, x, type = "all", return = "all", cn = FALSE)

Arguments

y

dependent variable

x

regressor

type

type of model to use: linear - "lm", exponential - "exp" and power trend "power". Default "all" use all three types.

return

what kind of data to return: "data" - fitted values; "plot" - ggplot of fitted values; "table" - contains information about coefficint of determination (R2), standard deviation (sd), mean absolute error (mae), mean relative error (mre) and Kling-Gupta efficiency (KGE); "all" - returns all;

cn

whether to keep column names set by function (default is FALSE)

data

data to compute trends

Examples

1
2
3
4
est <- best_tr(dta$evaporation, dta$radiation, cn=TRUE)
df <- as.data.frame(est$dta.n)
est$tab
plot_grid(plotlist = est$gg.all)

tgmwri/evapR documentation built on April 30, 2021, 10:23 p.m.