geom_variogram: Helper geom for variogram objects

Description Usage Arguments Examples

Description

Adds a ggplot2 layer with a line plot of a variogram model.

Usage

1
geom_variogram(x, max.dist, scaled = FALSE, ...)

Arguments

x

a variomodel object

max.dist

miximum distance (x-axis) to compute and draw the variogram

scaled

logical. If TRUE the total sill in the plot equals 1

...

not used.

This function is an adaptation to ggplot2 of the original function lines.variomodel in geoR.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## Computing and plotting empirical variogram
library(geoRcb)
library(ggplot2)
vg <- variog(s100, max.dist = 1)
ggplot(vg)

## Estimating parameters by wheighted least squares
vgmdl <- variofit(vg, ini = c(1, .3), fix.nugget = TRUE)

## Adding fitted model to the empirical variogram
ggplot(vg) + geom_variogram(vgmdl)

famuvie/ArchaeologicalFloors documentation built on May 16, 2019, 10:02 a.m.