A ggplot2-style layer using the StatDepthWeighted statistic

stat_depth_weighted(
  data = NULL,
  mapping = NULL,
  geom = "point",
  position = "identity",
  na.rm = FALSE,
  show.legend = NA,
  inherit.aes = TRUE,
  FUN = stats::weighted.mean,
  from = 0,
  to = 200,
  ...
)

Arguments

data

A SoilProfileCollection

mapping

Aesthetic mapping constructed via ggplot2::aes()

geom

Default: "point"

position

Default: "identity"

na.rm

Default: FALSE

show.legend

Default: NA

inherit.aes

Default: TRUE

FUN

A function. First argument is values, second argument is weights. Should accept na.rm argument. Default: weighted.mean()

from

Top depth of weighted function interval. Default: 0.

to

Bottom depth of weighted function interval. Default: 200.

...

additional arguments passed as parameters to ggplot2::layer()

Value

A ggplot2::layer() (a combination of data, Stat and geom with a potential position adjustment)