-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathget_caribbean.R
43 lines (40 loc) · 1.03 KB
/
get_caribbean.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
#' @rdname db_getter_backend
#' @export
get_caribbean <- function(db_url = get_db_url("caribbean")) {
check_connection_to_url(db_url)
# read data
caribbean <- db_url %>%
data.table::fread(
drop = c(
"UniqID",
"Island",
"Subregion",
"calCurves",
"Material"
),
colClasses = "character",
encoding = "UTF-8",
na.strings = c("", "\u2014"),
showProgress = FALSE
) %>%
dplyr::transmute(
labnr = .data[["LabNo"]],
c14age = .data[["Age"]],
c14std = .data[["Error"]],
c13val = .data[["d13C"]],
material = .data[["Type"]],
site = .data[["SiteName"]],
country = .data[["Country.Territory"]],
region = .data[["Region"]],
feature = .data[["Provenience"]],
lat = .data[["Lat"]],
lon = .data[["Lon"]],
shortref = .data[["Reference"]]
) %>%
dplyr::mutate(
sourcedb = "caribbean",
sourcedb_version = get_db_version("caribbean")
) %>%
as.c14_date_list()
return(caribbean)
}