-
Notifications
You must be signed in to change notification settings - Fork 12
/
get_jomon.R
44 lines (41 loc) · 1.05 KB
/
get_jomon.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#' @rdname db_getter_backend
#' @export
get_jomon <- function(db_url = get_db_url("jomon")) {
check_connection_to_url(db_url)
# read data
jomon <- db_url %>%
data.table::fread(
drop = c(
"SampleID",
"CombineGroup",
"SiteID",
"Site_Address_JP",
"MaterialType_JP",
"Phase",
"Phase_Details",
"PhaseAnalysis",
"Delta13CError"
),
encoding = "UTF-8",
showProgress = FALSE
) %>%
base::replace(., . == "", NA) %>%
dplyr::transmute(
labnr = .data[["LabCode"]],
c14age = .data[["CRA"]],
c14std = .data[["Error"]],
c13val = .data[["Delta13C"]],
material = .data[["MaterialType_En"]],
site = .data[["Site_Name_JP"]],
region = .data[["Region"]],
sitetype = .data[["Context_JP"]],
period = .data[["PotteryPhase_JP"]],
shortref = .data[["Source"]]
) %>%
dplyr::mutate(
sourcedb = "jomon",
sourcedb_version = get_db_version("jomon")
) %>%
as.c14_date_list()
return(jomon)
}