Skip to content

Commit

Permalink
Merge pull request #156 from ropensci/p3k14cv310
Browse files Browse the repository at this point in the history
 p3k14c
  • Loading branch information
nevrome authored Feb 2, 2022
2 parents a22e01f + c995165 commit cffc9e0
Show file tree
Hide file tree
Showing 14 changed files with 81 additions and 17 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: c14bazAAR
Title: Download and Prepare C14 Dates from Different Source Databases
Description: Query different C14 date databases and apply basic data cleaning, merging and calibration steps. Currently available databases: 14cpalaeolithic, 14sea, adrac, agrichange, aida, austarch, bda, calpal, caribbean, context, eubar, euroevol, irdd, jomon, katsianis, kiteeastafrica, medafricarbon, mesorad, nerd, pacea, palmisano, radon, radonb, rxpand, sard.
Version: 3.3.0
Description: Query different C14 date databases and apply basic data cleaning, merging and calibration steps. Currently available databases: 14cpalaeolithic, 14sea, adrac, agrichange, aida, austarch, bda, calpal, caribbean, context, eubar, euroevol, irdd, jomon, katsianis, kiteeastafrica, medafricarbon, mesorad, nerd, p3k14c, pacea, palmisano, radon, radonb, rxpand, sard.
Version: 3.4.0
Authors@R:
c(person(given = "Clemens",
family = "Schmid",
Expand Down
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export(get_kiteeastafrica)
export(get_medafricarbon)
export(get_mesorad)
export(get_nerd)
export(get_p3k14c)
export(get_pacea)
export(get_palmisano)
export(get_radon)
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# 3.4.0

- added getter function for p3k14c database: `get_p3k14c`

# 3.3.0

- made the default plot function a bit more powerful (#154)
Expand Down
3 changes: 2 additions & 1 deletion R/get_c14data.R
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,8 @@ get_all_parser_functions <- function() {
"nerd" = c14bazAAR::get_nerd,
"bda" = c14bazAAR::get_bda,
"rxpand" = c14bazAAR::get_rxpand,
"sard" = c14bazAAR::get_sard
"sard" = c14bazAAR::get_sard,
"p3k14c" = c14bazAAR::get_p3k14c
))
}

Expand Down
41 changes: 41 additions & 0 deletions R/get_p3k14c.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#' @rdname db_getter_backend
#' @export
get_p3k14c <- function(db_url = get_db_url("p3k14c")) {

check_connection_to_url(db_url)

# download and unzip data
p3k14c <- db_url %>%
data.table::fread(
colClasses = "character",
showProgress = FALSE,
na.strings = ""
) %>%
dplyr::mutate(
d13C = suppressWarnings(as.numeric(.data[["d13C"]])),
d13C = ifelse(.data[["d13C"]] == 0, NA, .data[["d13C"]])
) %>%
dplyr::transmute(
labnr = .data[["LabID"]],
c14age = .data[["Age"]],
c13val = .data[["d13C"]],
c14std = .data[["Error"]],
material = .data[["Material"]],
species = .data[["Taxa"]],
site = .data[["SiteName"]],
method = .data[["Method"]],
period = .data[["Period"]],
region = .data[["Continent"]],
country = .data[["Country"]],
lat = .data[["Lat"]],
lon = .data[["Long"]],
shortref = ifelse(is.na(.data[["Reference"]]), .data[["Source"]], .data[["Reference"]])
) %>%
dplyr::mutate(
sourcedb = "p3k14c",
sourcedb_version = get_db_version("p3k14c")
) %>%
as.c14_date_list()

return(p3k14c)
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ To suggest other archives to be queried you can join the discussion [here](https
* [`get_c14data("nerd")`](R/get_nerd.R) [**NERD**](https://github.com/apalmisano82/NERD): Near East Radiocarbon Dates Alessio Palmisano, Andrew Bevan, Dan Lawrence & Stephen Shennan (2021).
* [`get_c14data("pacea")`](R/get_pacea.R) [**pacea**](http://www.paleoanthro.org/media/journal/content/PA20110001_S01.zip): PACEA Geo-Referenced Radiocarbon Database for the late Middle Paleolithic, Upper Paleolithic, and initial Holocene in Europe by [Francesco D'Errico, William E. Banks, Marian Vanhaeren, Véronique Laroulandie and Mathieu Langlais](http://www.paleoanthro.org/media/journal/content/PA20110001.pdf) (2011).
* [`get_c14data("palmisano")`](R/get_palmisano.R) [**palmisano**](https://dx.doi.org/10.14324/000.ds.1575442): Regional Demographic Trends and Settlement Patterns in Central Italy: Archaeological Sites and Radiocarbon Dates by [Alessio Palmisano, Andrew Bevan and Stephen Shennan](https://openarchaeologydata.metajnl.com/articles/10.5334/joad.43/) (2018).
* [`get_c14data("p3k14c")`](R/get_p3k14c.R) [**p3k14c**](https://github.com/people3k): p3k14c: A synthetic global database of archaeological radiocarbon dates by [Darcy Bird, Lux Miranda, Marc Vander Linden, Robinson, Erick, R. Kyle Bocinsky, Chris Nicholson, José M. Capriles, Judson Byrd Finley, Eugenia M. Gayo, Adolfo Gil, Jade d’Alpoim Guedes, Julie A. Hoggarth, Andrea Kay, Emma Loftus, Umberto Lombardo, Madeline Mackie, Alessio Palmisano, Steinar Solheim, Robert L. Kelly, and Jacob Freeman](https://doi.org/10.1038/s41597-022-01118-7) (2022).
* [`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.
Expand Down
13 changes: 4 additions & 9 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"@context": "https://doi.org/10.5063/schema/codemeta-2.0",
"@type": "SoftwareSourceCode",
"identifier": "c14bazAAR",
"description": "Query different C14 date databases and apply basic data cleaning, merging and calibration steps. Currently available databases: 14cpalaeolithic, 14sea, adrac, agrichange, aida, austarch, bda, calpal, caribbean, context, eubar, euroevol, irdd, jomon, katsianis, kiteeastafrica, medafricarbon, mesorad, nerd, pacea, palmisano, radon, radonb, rxpand, sard.",
"description": "Query different C14 date databases and apply basic data cleaning, merging and calibration steps. Currently available databases: 14cpalaeolithic, 14sea, adrac, agrichange, aida, austarch, bda, calpal, caribbean, context, eubar, euroevol, irdd, jomon, katsianis, kiteeastafrica, medafricarbon, mesorad, nerd, p3k14c, pacea, palmisano, radon, radonb, rxpand, sard.",
"name": "c14bazAAR: Download and Prepare C14 Dates from Different Source Databases",
"relatedLink": "https://docs.ropensci.org/c14bazAAR",
"codeRepository": "https://github.com/ropensci/c14bazAAR",
"issueTracker": "https://github.com/ropensci/c14bazAAR/issues",
"license": "https://spdx.org/licenses/GPL-2.0",
"version": "3.3.0",
"version": "3.4.0",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
Expand Down Expand Up @@ -453,7 +453,7 @@
},
"SystemRequirements": null
},
"fileSize": "1269.267KB",
"fileSize": "1136.508KB",
"citation": [
{
"@type": "ScholarlyArticle",
Expand Down Expand Up @@ -492,10 +492,5 @@
}
}
}
],
"releaseNotes": "https://github.com/ropensci/c14bazAAR/blob/master/NEWS.md",
"readme": "https://github.com/ropensci/c14bazAAR/blob/master/README.md",
"contIntegration": ["https://github.com/ropensci/c14bazAAR/actions/workflows/check-release.yaml", "https://codecov.io/github/ropensci/c14bazAAR?branch=master"],
"developmentStatus": "https://www.repostatus.org/#active",
"keywords": ["radiocarbon-dates", "archaeology", "r"]
]
}
1 change: 1 addition & 0 deletions data-raw/db_info_table.csv
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ agrichange,2021-05-21,1,https://zenodo.org/record/4541470/files/AgriChange_14Cda
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
sard,2021-03-01,1,https://raw.githubusercontent.com/emmaloftus/Southern-African-Radiocarbon-Database/main/SARD_Mar2021_14C.csv
p3k14c,2021-08-03,1,https://raw.githubusercontent.com/people3k/p3k14c/1.0.0/inst/p3k14c_scrubbed_fuzzed.csv
17 changes: 17 additions & 0 deletions data-raw/variable_reference.csv
Original file line number Diff line number Diff line change
Expand Up @@ -594,3 +594,20 @@ shortref,sard,refcode
,sard,Biom
,sard,Sample context
,sard,Site Type
labnr,p3k14c,LabID
c14age,p3k14c,Age
c14std,p3k14c,Error
material,p3k14c,Material
species,p3k14c,Taxa
c13val,p3k14c,d13C
method,p3k14c,Method
lon,p3k14c,Long
lat,p3k14c,Lat
,p3k14c,LocAccuracy
period,p3k14c,Period
,p3k14c,SiteID
site,p3k14c,SiteName
country,p3k14c,Country
,p3k14c,Province
region,p3k14c,Continent
shortref,p3k14c,Reference;Source
Binary file modified data/db_info_table.rda
Binary file not shown.
2 changes: 1 addition & 1 deletion figures/README_map_figure.R
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ c14.map <- ggplot() +
color = "black"
) +
facet_wrap(~ sourcedb, ncol = 4) +
coord_sf(crs = st_crs('+proj=moll')) +
coord_sf(crs = sf::st_crs('+proj=moll')) +
theme_bw() +
theme(
legend.position = "none",
Expand Down
2 changes: 1 addition & 1 deletion man/c14bazAAR-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions man/db_getter_backend.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified man/figures/README_map_figure.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit cffc9e0

Please sign in to comment.