SWCalibrateR is a user-friendly web application. We designed SWCalibrateR to interactively estimate linear regression relationships of any couple of field data series. We specifically developed this toolbox to calibrate soil moisture sensors based on gravimetric soil moisture samples. The application has been implemented using R-shiny (

As a user you can upload your own dataset and dynamically filter it by categories like soil type, land use, soil depth and others. With SWCalibrateR you can visualise the filtered data scatter and the estimated linear model. You can diagnose your model estimate and thus easily remove outliers influencing your model estimate. SWCalibrateR handles robust estimates of linear models besides ordinary least square estimation. Additional features are an interactive data table view and mapping of the data points.

In environmental research we often need to estimate a linear regression relationship for multi-variable field data series, linked to several attributes. With SWCalibrateR we provide a user-friendly web application to facilitate this task specifically for calibration of soil moisture sensors.

Studies on plant-soil-water interactions for agronomical, as well as for hydrological application, frequently require accurate measurements of soil moisture. Soil moisture varies largely in time and space and is commonly determined by continuous measurement of volumetric soil water content (VWC) by means of time domain reflectometry (TDR). TDR is a non-destructive method to retrieve VWC using a single generalized calibration equation [

The application’s current features allow the user to retrieve calibration equations interactively by filtering the data and deciding whether to use ordinary least square (OLS) or the “maximum likelihood type” MM-type estimator. This means, when several soil moisture sensors are installed in heterogeneous soils and locations, SWCalibrateR permits one to find the best calibration equation by grouping the data according to user defined criteria. Furthermore, the user can assess model diagnostic and remove leverage and outlier points if needed. Additional features are an interactive data table view and mapping of the data points.

SWCalibrateR is built using the R-Shiny framework [

For easy access to the R project open the SWCalibrateR.Rproj file. Within the project, the developer can now discover and adapt the source code to his needs. Pull requests to the GitHub repository are very welcome. Please feel free to report bugs to the GitHub issues:

As an developer be aware that the application, besides R (>=3.5.0), depends on the following R packages: Cairo (>=1.5–9), dplyr (>=0.7.6), ggplot2 (>=3.0.0), leaflet (>= 2.0.2), leaflet.extras (>=1.0.0), robustbase (>=0.93–3), shiny (>=1.1.0), tidyr (>=0.8.1). These can be installed manually using the devtools library:

By installing the application in RStudio via R-devtools R libraries, the software depends on, should be installed on the fly.

Once installed the user can load the package and start the SWCalibrateR application:

Within the package, we make available an example dataset consisting of VWC sensor and VWC sample observation data paired with metadata. This dataset does load in general when the user starts the application. For further information about the example dataset have a look at its documentation or load the dataset:

The user can upload their own dataset and analyse it. Find the tab for data upload at the left corner of the sidebar (see Figure

OLS model estimation for an example data subset. The subset arises from a choice in categories at the left sidebar (Project 02, forest ecosystems, upper soil layer, and sensor type CS655). Zoom in to the main data cloud is activated. Further options are a robust MM-type estimator, and visualization of row IDs. The user can browse and upload their own dataset. The application is organized in five panels. The first one shows the current OLS model fit (scatter plot accompanied by 95% confidence interval for the model estimate). A potential outlier point is brushed.

The application comes with five main panels:

You can find a working online example of the application here:

Below we describe in more detail the functionality of the application going through a working example.

The input dataset is visualised in the panel

The data subset scatter and model fit, accompanied by the 95% confidence interval, is visualised in panel

MM-type model estimation for an example data subset. Same data subset as in Figure ^{2} are comparable to the OLS estimate without point #2, which does refer to y = 0.062 + 0.87×, r^{2} = 59. Applying visualisation of the row IDs facilitates identifying leverage and outlier points with the model diagnostic plots (panel Diagnostics).

In the sidebar the user can control the regression method, visualise the row ID of the subset data table (row.ID in panel

MM-type estimation (as implemented in

The panel

Model diagnostic plots for OLS estimator. The model diagnostic plots are applied to answer the following questions: (1) Do the model residuals have non-linear patterns? (2) Are the model residuals normally distributed? (3) Are the model residuals spread equally along the ranges of predictors? (4) Which are the influential outliers? Facing these questions helps testing underlying assumptions for OLS and in the end is beneficial for detection of outlier and leverage points (e.g. point #2).

Model diagnostic plots for MM-type estimator (further explanation see caption Figure

Plot 1. Residuals vs. Fitted Values

Do the model residuals have non-linear patterns? Besides non-linearity of the residuals, this plot inherits a first hint towards unequal error variances, and outliers. For our example in the drier range of the fitted soil moisture values (points #11 and #18) and for one point (#2) in wet conditions we see higher error variances and thus non-linearity of the model residuals (Figure

Plot 2. Normal Q–Q vs. Residuals

Are the model residuals normally distributed? Normal distribution of the residual is an underlying assumption for OLS. Strong deviations from the y=x line, as we can see in Figure

Plot 3. Scale-Location

Are the model residuals spread equally along the ranges of predictors? Alike in plot 1 we check the assumption of equal variance in the residuals (homoscedasticity) this time applying standardised residuals. Summing up we can identify three outliers in Figure

Plot 4a.

Which are the influential outliers? Unlike the other plots, here patterns are not relevant. We simple look for cases outside the curved lines, the Cook’s distance. These points should be excluded from model estimation with care, as they do influence the regression result. Point #2 can be clearly identified as outlier and leverage point.

Plot 4b.

Alike in plot 4a we test for influential points. The plot in Figure

Interpretation of standardised residuals vs. robust distance. The plot divides the value range in four regions marked by lines and coloured points: (1) Regular, (2) Outlier, (3) Leverage, (4) Outlier and Leverage. Points in the fourth category are of major importance as they are outlier points, influencing the model fit if removed from estimation.

SWCalibrateR has been tested in with several web browsers, including Google Chrome, Safari, Firefox, and IE10+. The application is available at

SWCalibrateR is a platform-independent software package, the web application is compatible with modern web browsers (IE 10+, Google Chrome, Firefox, Safari, etc.).

R

None

SWCalibrateR depends on R (>=3.5.0) and several R packages: Cairo (>=1.5–9), dplyr (>=0.7.6), ggplot2 (>=3.0.0), leaflet (>=2.0.2), leaflet.extras (>=1.0.0), robustbase (>= 0.93–3), shiny (>= 1.1.0), tidyr (>=0.8.1).

Johannes Brenner

Giulio Genova

Georg Niedrist

Giacomo Bertoldi

Stefano Della Chiesa

SWCalibrateR is a reusable toolbox, with which researchers in the fields of agriculture and hydrology can easily calibrate soil moisture sensors depending on their requirements. Previously researchers might have adopted a simple spreadsheet to retrieve calibration equation, now SWCalibrateR does fill this gap. Being implemented as a user-friendly package within the R environment, including a web interface a large variety of users will be able to reuse the software. Sensor calibration is a very common task in environmental science, thus, SWCalibrateR could be further developed with a generalised design to calibrate any sort of sensor or measurements. Moreover, further development could consider import time series of uncalibrated measurements and provide in output calibrated time series which in turn can be directly used for any sort of application which require high quality data.

The authors have no competing interests to declare.