-
Notifications
You must be signed in to change notification settings - Fork 12
/
get_rado.nb.R
41 lines (38 loc) · 1.08 KB
/
get_rado.nb.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
#' @rdname db_getter_backend
#' @export
get_rado.nb <- function(db_url = get_db_url("rado.nb")) {
check_connection_to_url(db_url)
# read data
rado.nb <- db_url %>%
data.table::fread(
quote = "",
colClasses = "character",
showProgress = FALSE
) %>%
base::replace(., . == "", NA) %>%
base::replace(., . == "n/a", NA) %>%
base::replace(., . == "n.a.", NA) %>%
dplyr::transmute(
labnr = .data[["LABNR"]],
c14age = .data[["C14AGE"]],
c14std = .data[["C14STD"]],
c13val = .data[["C13"]],
material = .data[["MATERIAL"]],
species = .data[["SPECIES"]],
country = .data[["COUNTRY"]],
site = .data[["SITE"]],
period = .data[["PERIOD"]],
culture = .data[["CULTURE"]],
sitetype = .data[["FEATURETYPE"]],
feature = .data[["FEATURE"]],
lat = .data[["LATITUDE"]],
lon = .data[["LONGITUDE"]],
shortref = .data[["REFERENCE"]]
) %>%
dplyr::mutate(
sourcedb = "rado.nb",
sourcedb_version = get_db_version("rado.nb")
) %>%
as.c14_date_list()
return(rado.nb)
}