options(htmltools.dir.version = FALSE)
xaringanthemer::style_mono_accent( base_color = "#2f4174", inverse_header_color = "#FFFFFF" )
labID
, age
, error
, depth
, and cc
ID
and depth
ID
and depth
Current version can be installed from the GitHub repository:
install.packages("remotes") remotes::install_github("special-uor/ageR")
To verify you are running the latest version, run the following command:
?ageR
class: inverse, center, middle
ageR::file_structure(entity = "X", am = "bacon")
core <- data.frame(labID = paste0("X", sprintf("%03d", 1:5)), age = c(50, 200, 1150, 2060, 4050), error = c(10, 15, 5, 1, 70), depth = c(5, 100, 230, 300, 450), cc = 1) knitr::kable(core)
sample_depths <- data.frame(id = 1:100, depth = seq(0, 500, length.out = 100)) knitr::kable(head(sample_depths))
hiatus <- data.frame(id = c(1, 2), depth = c(50, 150)) knitr::kable(hiatus)
ageR::create_input(data = list(sample_depths = sample_depths, core = core, # Optional hiatus = NULL, not_used = NULL), wdir = "./", entity = "X", am = "bacon")
conn <- dabr::open_conn_mysql("RPD-latest") query <- paste0( "SELECT entity_name, entity.ID_ENTITY as entity_id, lab_number AS labID, age_C14 AS age, error, avg_depth*100 AS depth, date_type, thickness FROM date_info INNER JOIN entity ON date_info.ID_ENTITY = entity.ID_ENTITY WHERE latitude >= 45") rpd <- dabr::select(conn, query, quiet = TRUE) nrow(rpd)
`%>%` <- dplyr::`%>%` rpd <- rpd %>% dplyr::filter(!is.na(age)) %>% dplyr::filter(!is.na(error)) %>% dplyr::filter(!is.na(depth)) %>% dplyr::mutate(error = ifelse(error <= 0, 1, error)) %>% dplyr::arrange(depth) %>% dplyr::mutate(cc = ifelse(grepl("*carbon", date_type), 1, 0)) entities <- sort(unique(rpd$entity_name)) head(entities)
test_entity <- "Burnt Knob core 1" test_entity_id <- unique(rpd$entity_id[rpd$entity_name == test_entity]) # Extract sampling depths query <- paste0("SELECT ID_SAMPLE AS id, sample_depth*100 AS depth FROM sample WHERE ID_ENTITY = ", test_entity_id) sample_tb <- dabr::select(conn, query, quiet = TRUE) sample_tb <- sample_tb %>% dplyr::filter(depth != -9999) # Extract core data my_core <- rpd[rpd$entity_name == test_entity, c("labID", "age", "error", "depth", "cc")] # Create input ageR::create_input(data = list(core = my_core, sample_depths = sample_tb), wdir = "./", entity = test_entity)
ageR::Bacon(wdir = "./", entity = "X", # Optional parameters cpus = 1, postbomb = 0, cc = 0, seed = NA, alt_depths = NULL, quiet = FALSE, acc_step = 5, acc_lower = NULL, acc_upper = NULL, thick_step = 5, thick_lower = NULL, thick_upper = NULL, dry_run = FALSE, ...)
out <- ageR::Bacon(wdir = "./", entity = "X", dry_run = TRUE, quiet = TRUE)
ccdir <- "./ccurves" ageR::mix_curves(proportion = 0.5, cc1 = 1, cc = 3, name = "neotropics.14C", dirname = ccdir)
out <- ageR::Bacon(wdir = "./", entity = "X", cc4 = "neotropics.14C", ccdir = ccdir)
Create new "Issues" to request new features, report an error, etc.
https://github.com/special-uor/ageR/issues
class: center, middle
Slides created using the R package xaringan.
unlink("X", recursive = TRUE, force = TRUE) unlink("ccurves", recursive = TRUE, force = TRUE) unlink("Burnt Knob core 1", recursive = TRUE, force = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.