## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(collapse = TRUE, comment = "#>", fig.width = 6.5,
                      fig.height = 4.2, dpi = 120)

## ----setup--------------------------------------------------------------------
library(trialSizing)

## ----data---------------------------------------------------------------------
grid1 <- as.matrix(uniformity_trial[uniformity_trial$trial == "T1",
                                    grep("^col", names(uniformity_trial))])
dim(grid1)

## ----check--------------------------------------------------------------------
chk <- check_trial(grid1)
chk

## ----variogram----------------------------------------------------------------
chk$checks[[1]]$variogram[c("model", "nugget", "sill", "range",
                            "nugget_ratio", "dependence")]

## ----map----------------------------------------------------------------------
plot(chk)

## ----map-blues----------------------------------------------------------------
plot(chk, palette = "blues", point_values = FALSE)

## ----map-nosurface------------------------------------------------------------
plot(chk, surface = FALSE)

## ----save, eval = FALSE-------------------------------------------------------
# plot(chk, save = TRUE, file = "trial.tiff", format = "tiff", dpi = 300)

## ----multi--------------------------------------------------------------------
grids <- lapply(split(uniformity_trial, uniformity_trial$trial),
                function(d) as.matrix(d[, grep("^col", names(d))]))

check_trial(grids)$summary

## ----multi-map, fig.height = 3.4----------------------------------------------
plot(check_trial(grids))

## ----prime--------------------------------------------------------------------
check_trial(matrix(rnorm(77, 100, 10), nrow = 7))$checks[[1]]$issues

