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, ...)

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")
counts <- as_count(zuni)

## 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(counts, dates = mid)
head(mc_dates)
#> LZ1105 LZ1103 LZ1100 LZ1099 LZ1097 LZ1096 
#>   1162   1138   1154   1091   1092    841 

## Plot
plot(mc_dates, select = 100:125)


## Bootstrap resampling
boot <- bootstrap(mc_dates, n = 30)
head(boot)
#>         min     mean  max     lower     upper     Q25  Q50     Q75
#> LZ1105 1123 1158.367 1202 1152.0271 1164.7062 1148.50 1157 1166.75
#> LZ1103 1092 1141.067 1172 1133.0203 1149.1130 1131.00 1143 1156.50
#> LZ1100 1085 1160.700 1213 1151.5088 1169.8912 1150.25 1163 1174.00
#> LZ1099 1084 1091.333 1097 1089.9454 1092.7213 1088.00 1091 1094.00
#> LZ1097  938 1085.233 1175 1061.5555 1108.9112 1066.00 1092 1138.00
#> LZ1096  738  830.700  996  807.7815  853.6185  789.00  841  841.00

## Jackknife resampling
jack <- jackknife(mc_dates)
head(jack)
#>             mean        bias      error
#> LZ1105 1162.0556   0.9444444  27.537909
#> LZ1103 1137.5556  -7.5555556  68.762698
#> LZ1100 1153.6111  -6.6111111  50.237614
#> LZ1099 1091.0556   0.9444444   9.860289
#> LZ1097 1091.6111  -6.6111111  70.898489
#> LZ1096  849.6667 147.3333333 268.508845