This document reproduces the figures illustrating the geochemical data in Kwak and Marwick ‘Food processing and pottery use in the Early Bronze Age, Central Korean Peninsula’
library(kwakmarwick2015)
knitr::opts_chunk$set(cache = TRUE)
The density distribution of the radiocarbon dates from the two sites.
# read data in, three columns Name = lab code, Date = radiocarbon age, Uncertainty = error
dates_KM <- read.csv('data/radiocarbon_KM.csv', stringsAsFactors = FALSE)
dates_SS <- read.csv('data/radiocarbon_SS.csv', stringsAsFactors = FALSE)
# make date names
dates_KM$Name <- paste0("KM_", dates_KM[,1])
dates_SS$Name <- paste0("SS_", dates_SS[,1])
# remove spaces
dates_KM$Name <- gsub("[[:space:]]", "_", dates_KM$Name)
dates_SS$Name <- gsub("[[:space:]]", "_", dates_SS$Name)
# split age and error term
library(stringr)
# KM
date_split <- str_split_fixed(dates_KM$C14.date..BP..uncalibrated., "pm", 2)
date_split_Age <- as.numeric(gsub("[^0-9]", "", date_split[, 1]))
date_split_Error <- as.numeric(gsub("[^0-9]", "", date_split[, 2]))
# combine into data frame
dates_KM <- data.frame(Name = dates_KM$Name,
Date = date_split_Age,
Uncertainty = date_split_Error)
# SS
date_split <- str_split_fixed(dates_SS$C14.date..BP..uncalibrated., "\\?\\?", 2)
date_split_Age <- as.numeric(gsub("[^0-9]", "", date_split[, 1]))
date_split_Error <- as.numeric(gsub("[^0-9]", "", date_split[, 2]))
# combine into data frame
dates_SS <- data.frame(Name = dates_SS$Name,
Date = date_split_Age,
Uncertainty = date_split_Error)
# combine all dates into one
dates <- rbind(dates_KM, dates_SS)
dates <- dates[complete.cases(dates), ]
# use the R package BChron...
library(Bchron)
## Loading required package: inline
## Bchron v4.0 - see http://mathsci.ucd.ie/~parnell_a/Rpack/Bchron.htm for updates
# remove NAs
dates_SS <- dates_SS[complete.cases(dates_SS),]
# get estimation of activity through age as proxy
Dens_KM = BchronDensity(ages=dates_KM$Date, ageSds=dates_KM$Uncertainty, calCurves=rep('intcal13', nrow(dates_KM)))
Dens_SS = BchronDensity(ages=dates_SS$Date, ageSds=dates_SS$Uncertainty, calCurves=rep('intcal13', nrow(dates_SS)))
# get line for plotting
Dens_KM_plot <- BchronDensity_plot_params("KM", Dens_KM)
Dens_SS_plot <- BchronDensity_plot_params("SS", Dens_SS)
plot_all <- rbind(Dens_KM_plot, Dens_SS_plot)
library(ggplot2)
ggplot(plot_all, aes(dateGrid, densFinal, colour = ID)) +
geom_line(size = 0.5) +
theme_minimal(base_size = 14) +
xlab("calibrated years BP") +
ylab("Density") +
xlim(1000,4000)
## Warning: Removed 88 rows containing missing values (geom_path).
The chromatogram of the GC-MS analysis from one of our samples from the Sosa-Dong site (SOS049). Due to degradation, we usually observe medium- and long-chain saturated fatty acids. 5-a Cholestane was added as an internal standard (132 ng / microliter).
# Input data from csv file
SOS049 <- read.csv(file="data/GC-MS_exported_data_Figure5a.csv", header=TRUE, sep=",")
make_retention_times_plot(SOS049)
## Warning: package 'scales' was built under R version 3.2.1
The second chromatogram, sample KIM061
# Input data from csv file
KIM061 <- read.csv(file="data/GC-MS_exported_data_Figure5b.csv", header=TRUE, sep=",")
make_retention_times_plot_no_labels(KIM061)
The results of CSIA by GC-C-IRMS of the samples from the Sosa-Dong (SO) and Kimpo-Yangchon (KI) site using the reference from Craig et al., 2011 and Steele et al., 2010.
# read in data
CSIA_KM <- read.csv('data/CSIA_KM.csv', stringsAsFactors = FALSE)
CSIA_SS <- read.csv('data/CSIA_SS.csv', stringsAsFactors = FALSE)
# combine both into one dataframe
CSIA_KM_and_SS <- rbind(CSIA_KM, CSIA_SS)
# get site ID to control plotting colour and shape
CSIA_KM_and_SS$ID <- substr(CSIA_KM_and_SS$Sample.No., 1, 2)
# draw plot
make_C16_C18_scatter_plot(CSIA_KM_and_SS)
Here are the details of the computational environment that our analysis was conducted in:
sessionInfo()
## R version 3.2.0 alpha (2015-03-25 r68091)
## Platform: x86_64-w64-mingw32/x64 (64-bit)
## Running under: Windows 7 x64 (build 7601) Service Pack 1
##
## locale:
## [1] LC_COLLATE=English_United States.1252
## [2] LC_CTYPE=English_United States.1252
## [3] LC_MONETARY=English_United States.1252
## [4] LC_NUMERIC=C
## [5] LC_TIME=English_United States.1252
##
## attached base packages:
## [1] grid stats graphics grDevices utils datasets methods
## [8] base
##
## other attached packages:
## [1] scales_0.2.5 ggplot2_1.0.1
## [3] Bchron_4.1.1 inline_0.3.14
## [5] stringr_1.0.0 kwakmarwickjas2015_0.0.1.9000
##
## loaded via a namespace (and not attached):
## [1] Rcpp_0.11.6 knitr_1.10.5 magrittr_1.5 MASS_7.3-40
## [5] munsell_0.4.2 mclust_5.0.1 colorspace_1.2-6 ellipse_0.3-8
## [9] lattice_0.20-31 plyr_1.8.3 tools_3.2.0 hdrcde_3.1
## [13] gtable_0.1.2 coda_0.17-1 htmltools_0.2.6 yaml_2.1.13
## [17] digest_0.6.8 reshape2_1.4.1 formatR_1.2 codetools_0.2-11
## [21] evaluate_0.7 rmarkdown_0.7 labeling_0.3 stringi_0.4-1
## [25] proto_0.3-10