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

## Data from Peeples and Schachner 2012
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     1207 1208.633   1.633333  29.99136
#> LZ0783     1128 1128.000   0.000000  24.62827
#> LZ0782     1100      NaN        NaN        NA
#> LZ0778     1227 1217.300  -9.700000  35.05085
#> LZ0777     1238      NaN        NaN        NA
#> LZ0776     1028 1008.600 -19.400000 112.79447

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

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

# }