Learn R Programming

aclhs (version 1.0.1)

aclhs.plot_variogram_comparison: Plot the Variogram comparison of the acLHS subsamples.

Description

Plots the acLHS-sampled Variogram against the Variogram of the original data. A best-fit curve of the original Variogram is added for clearer comparison.

Usage

aclhs.plot_variogram_comparison(df, aclhs_samples, vario_params, plot_params)

Value

No return value, called for side effects

Arguments

df

The original dataframe

aclhs_samples

The acLHS-derived sample indices

vario_params

The parameters to set for computing a Variogram

plot_params

The plotting parameters to use

Examples

Run this code
#' ## Get the data of interest and get the acLHS sample indices
data(ex_data_2D)
input2D <- ex_data_2D
v_params <- aclhs.vario_params(num_lags=10, dir=0, tol=90, min_pairs=1)
aclhs_sam <- aclhs(df=input2D, num_samples=50, weights=c(1,1,1),
                   iter=100, vario_params=v_params)

## Set plotting parameters
p_params <- aclhs.plot_params(file_name=tempfile(fileext=".png"),
                              xlab=expression(bold("Distance [km]")),
                              ylab=expression(bold("Semivariance")))

## Create plot
aclhs.plot_variogram_comparison(df=input2D, aclhs_samples=aclhs_sam,
                                vario_params=v_params, plot_params=p_params)

Run the code above in your browser using DataLab