Skip to contents

MCD Plot

Usage

# S4 method for MeanDate
autoplot(object, ..., select = NULL, decreasing = TRUE)

# S4 method for MeanDate,missing
plot(x, select = NULL, decreasing = TRUE, ...)

# S4 method for SimulationMeanDate
autoplot(object, ..., select = NULL, decreasing = TRUE)

# S4 method for SimulationMeanDate,missing
plot(x, select = NULL, decreasing = TRUE, ...)

Arguments

object, x

A MeanDate object.

...

Currently not used.

select

A numeric or character vector giving the selection of the assemblage that are drawn.

decreasing

A logical scalar: should the sort be increasing or decreasing?

Value

  • autoplot() returns a ggplot object.

  • plot() is called it for its side-effects: it results in a graphic being displayed (invisibly returns x).

See also

mcd()

Other plotting methods: plot_aoristic, plot_event, plot_fit, plot_time()

Author

N. Frerebeau

Examples

## Mean Ceramic Date
## Coerce the zuni dataset to an abundance (count) matrix
data("zuni", package = "folio")

## Set the start and end dates for each ceramic type
dates <- list(
  LINO = c(600, 875), KIAT = c(850, 950), RED = c(900, 1050),
  GALL = c(1025, 1125), ESC = c(1050, 1150), PUBW = c(1050, 1150),
  RES = c(1000, 1200), TULA = c(1175, 1300), PINE = c(1275, 1350),
  PUBR = c(1000, 1200), WING = c(1100, 1200), WIPO = c(1125, 1225),
  SJ = c(1200, 1300), LSJ = c(1250, 1300), SPR = c(1250, 1300),
  PINER = c(1275, 1325), HESH = c(1275, 1450), KWAK = c(1275, 1450)
)

## Calculate date midpoints
mid <- vapply(X = dates, FUN = mean, FUN.VALUE = numeric(1))

## Calculate MCD
mc_dates <- mcd(zuni[100:125, ], dates = mid)
head(mc_dates)
#> LZ0789 LZ0783 LZ0782 LZ0778 LZ0777 LZ0776 
#>   1207   1128   1100   1227   1238   1028 

## Plot
plot(mc_dates)


# \donttest{
## Bootstrap resampling
boot <- bootstrap(mc_dates, n = 30)
head(boot)
#>        original      mean      bias    error
#> LZ0789     1012  915.9000 -96.10000 40.95780
#> LZ0783      995  947.5667 -47.43333 24.98232
#> LZ0782     1100 1100.0000   0.00000  0.00000
#> LZ0778       NA        NA        NA       NA
#> LZ0777     1275 1275.0000   0.00000  0.00000
#> LZ0776      880  824.1333 -55.86667 47.18177

## Jackknife resampling
jack <- jackknife(mc_dates)
head(jack)
#>            mean       bias     error
#> LZ0789 1206.833  -2.833333  32.47264
#> LZ0783 1128.111   1.888889  21.19778
#> LZ0782      NaN        NaN       NaN
#> LZ0778 1226.778  -3.777778  22.52269
#> LZ0777      NaN        NaN       NaN
#> LZ0776 1024.889 -52.888889 127.64539

## Simulation
sim <- simulate(mc_dates, n = 30, interval = "percentiles")
plot(sim)

# }