From 76b34d2ad6b691058f9f53ca04f60bb0f99bb636 Mon Sep 17 00:00:00 2001 From: Dirk Seidensticker Date: Thu, 2 Sep 2021 14:37:33 +0200 Subject: [PATCH 1/2] fragment of an initial parser --- R/get_intchron.R | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 R/get_intchron.R diff --git a/R/get_intchron.R b/R/get_intchron.R new file mode 100644 index 0000000..1a52cdf --- /dev/null +++ b/R/get_intchron.R @@ -0,0 +1,32 @@ +#' @rdname db_getter_backend +#' @export + +library(rintchron) + +get_intchron <- function(){ + + sadb <- intchron(c("sadb")) %>% + dplyr::transmute( + method =, + labnr = .data[["labcode"]], + c14age = .data[["r_date"]], + c14std = .data[["r_date_sigma"]], + c13val = .data[["d13C"]], + site = .data[["site"]], + feature = .data[["context"]], + period = .data[["period"]], + culture = .data[["subperiod"]], + material = .data[["material"]], + species = .data[["species"]], + region = .data[["region"]], + country = .data[["country"]], + lat = .data[["latitude"]], + lon = .data[["longitude"]], + shortref = .data[["refs"]] + ) %>% + as.c14_date_list() + + return(sadb) + +} + From 69f68d34e905cc2fa728780b0e2d8d419aa35404 Mon Sep 17 00:00:00 2001 From: Dirk Seidensticker Date: Mon, 6 Sep 2021 16:24:43 +0200 Subject: [PATCH 2/2] general parser and some metadata --- DESCRIPTION | 1 + NAMESPACE | 1 + R/get_c14data.R | 4 +++- R/get_intchron.R | 24 ++++++++++++++++++------ README.md | 2 ++ data-raw/db_info_table.csv | 2 ++ data/db_info_table.rda | Bin 1636 -> 1686 bytes man/db_getter_backend.Rd | 7 +++++-- 8 files changed, 32 insertions(+), 9 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index d6f0c88..35dadfd 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -85,6 +85,7 @@ Suggests: plyr, readxl, rgeos, + rintchron, rmarkdown, rnaturalearth, rworldmap, diff --git a/NAMESPACE b/NAMESPACE index fcbb5fd..02f890d 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -46,6 +46,7 @@ export(get_db_version) export(get_emedyd) export(get_eubar) export(get_euroevol) +export(get_intchron) export(get_irdd) export(get_jomon) export(get_katsianis) diff --git a/R/get_c14data.R b/R/get_c14data.R index f5795da..924336a 100644 --- a/R/get_c14data.R +++ b/R/get_c14data.R @@ -150,7 +150,9 @@ get_all_parser_functions <- function() { "katsianis" = c14bazAAR::get_katsianis, "nerd" = c14bazAAR::get_nerd, "bda" = c14bazAAR::get_bda, - "rxpand" = c14bazAAR::get_rxpand + "rxpand" = c14bazAAR::get_rxpand, + "sadb" = c14bazAAR::get_intchron, + "egyptdb" = c14bazAAR::get_intchron )) } diff --git a/R/get_intchron.R b/R/get_intchron.R index 1a52cdf..9a57688 100644 --- a/R/get_intchron.R +++ b/R/get_intchron.R @@ -1,11 +1,24 @@ #' @rdname db_getter_backend #' @export -library(rintchron) +#library(rintchron) -get_intchron <- function(){ +get_intchron <- function(db_name){ - sadb <- intchron(c("sadb")) %>% + # DATABASES: + # sadb: works + # - also has: subperiod + # egyptdb: works + # - also has: dynasty, reign + # intimate: errors + # nrcf: errors + # oxa: errors + # + # sadb <- rintchron::intchron("sadb") + # egyptdb <- rintchron::intchron("egyptdb") + # setdiff(names(egyptdb), names(sadb)) + + intchron <- rintchron::intchron(c(db_name)) %>% dplyr::transmute( method =, labnr = .data[["labcode"]], @@ -15,7 +28,7 @@ get_intchron <- function(){ site = .data[["site"]], feature = .data[["context"]], period = .data[["period"]], - culture = .data[["subperiod"]], + #culture = .data[["subperiod"]], material = .data[["material"]], species = .data[["species"]], region = .data[["region"]], @@ -26,7 +39,6 @@ get_intchron <- function(){ ) %>% as.c14_date_list() - return(sadb) - + return(intchron) } diff --git a/README.md b/README.md index 8a14d3d..1d5bae5 100644 --- a/README.md +++ b/README.md @@ -160,6 +160,7 @@ To suggest other archives to be queried you can join the discussion [here](https * [`get_c14data("calpal")`](R/get_calpal.R) [**calpal**](https://uni-koeln.academia.edu/BernhardWeninger/CalPal): Radiocarbon Database of the CalPal software package by Bernhard Weninger. See [nevrome/CalPal-Database](https://github.com/nevrome/CalPal-Database) for an interface. * [`get_c14data("caribbean")`](R/get_caribbean.R) [**caribbean**](https://github.com/philriris/caribbean-14C/): A compilation of 2147 anthropogenic radiocarbon (14C) dates for the Caribbean region from 504 sites across 57 islands by **Phil Riris** (2021). * [`get_c14data("context")`](R/get_context.R) [**context**](http://context-database.uni-koeln.de/): Collection of radiocarbon dates from sites in the Near East and neighboring regions (20.000 - 5.000 calBC) by Utz Böhner and Daniel Schyle. +* [`get_c14data("egyptdb")`](R/get_intchron.R) [**egyptdb**](https://github.com/jgregoriods/rxpand): Egyptian Radiocarbon Database hosted by ORAU. * [`get_c14data("eubar")`](R/get_eubar.R) [**eubar**](https://telearchaeology.org/eubar-c14-database/): A database of 14C measurements for the European Bronze Age by [Gacomo Capuzzo](https://telearchaeology.org/EUBAR/). * [`get_c14data("euroevol")`](R/get_euroevol.R) [**euroevol**](https://discovery.ucl.ac.uk/1469811/): Cultural Evolution of Neolithic Europe Dataset by [Katie Manning, Sue Colledge, Enrico Crema, Stephen Shennan and Adrian Timpson](https://openarchaeologydata.metajnl.com/articles/10.5334/joad.40/). * [`get_c14data("irdd")`](R/get_irdd.R) [**irdd**](https://sites.google.com/site/chapplearchaeology/irish-radiocarbon-dendrochronological-dates): [Robert M Chapple](https://doi.org/10.5281/zenodo.3367518)'s Catalogue of Radiocarbon Determinations & Dendrochronology Dates is a free-to-download resource for Irish archaeology. @@ -173,6 +174,7 @@ To suggest other archives to be queried you can join the discussion [here](https * [`get_c14data("radon")`](R/get_radon.R) [**radon**](https://radon.ufg.uni-kiel.de/): Central European and Scandinavian database of 14C dates for the Neolithic and Early Bronze Age by [Dirk Raetzel-Fabian, Martin Furholt, Martin Hinz, Johannes Müller, Christoph Rinne, Karl-Göran Sjögren und Hans-Peter Wotzka](https://www.jna.uni-kiel.de/index.php/jna/article/view/65). * [`get_c14data("radonb")`](R/get_radonb.R) [**radonb**](https://radon-b.ufg.uni-kiel.de/): Database for European 14C dates for the Bronze and Early Iron Age by Jutta Kneisel, Martin Hinz, Christoph Rinne. * [`get_c14data("rxpand")`](R/get_rxpand.R) [**rxpand**](https://github.com/jgregoriods/rxpand): Radiocarbon dates for the spread of farming and ceramics in tropical South America by **Jonas Gregorio de Souza**. +* [`get_c14data("sadb")`](R/get_intchron.R) [**sadb**](https://github.com/jgregoriods/rxpand): An archaeological radiocarbon database for southern Africa by [Emma Loftus, Peter J. Mitchell & Christopher Bronk Ramsey](https://www.cambridge.org/core/journals/antiquity/article/abs/an-archaeological-radiocarbon-database-for-southern-africa/26FE99E995C4507015704D552CB0C196) and hosted by ORAU. ### Contributing diff --git a/data-raw/db_info_table.csv b/data-raw/db_info_table.csv index 95fdf53..edec27c 100644 --- a/data-raw/db_info_table.csv +++ b/data-raw/db_info_table.csv @@ -26,3 +26,5 @@ rxpand,2020-10-20,1,https://raw.githubusercontent.com/jgregoriods/rxpand/master/ agrichange,2021-05-21,1,https://zenodo.org/record/4541470/files/AgriChange_14Cdatabase.xlsx caribbean,2021-05-21,1,https://raw.githubusercontent.com/philriris/caribbean-14C/main/data/caribbean_14C.csv aida,today,1,https://raw.githubusercontent.com/apalmisano82/AIDA/main/dates.csv +sadb,2021-09-06,1,sadb +egyptdb,2021-09-06,1,egyptdb diff --git a/data/db_info_table.rda b/data/db_info_table.rda index 8d69692f943a2681ec0b5506f7705245120ebfc0..433f71469b7ae56b8a2ab951bd7f437c1503d6d4 100644 GIT binary patch literal 1686 zcmV;H25I?1T4*^jL0KkKS%d#MH2?$Zf9e18=>h@=|N6hb|MH0ssU62mk;9 z;08Z0ZMPEDbr$B=gUSYk zCYYLO7$BOOexRB((0ZB&qG$~?X`lvx&>R^CjR0iR5Ys`BVi-Ws8Zj{%000<;F(#Ug zPh?F^9--=KvV%YX8UsK82AVVn20^1h88pN+&}0~f5HtpiOh$kJ1dxfKAuy@=7^(P* zHq^=u1160CdX1<7>H(qZcgh52WR%d?-eD||8Cay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