@@ -8,32 +8,34 @@ lines <- pmap_chr(dataset_info, function(dataset_id, dataset_name, dataset_summa
88 date_created <- pluck(rest, "date_created", .default = NULL)
99 file_size <- pluck(rest, "file_size", .default = NULL)
1010
11- if (grep("^[a-zA-Z0-9]+[0-9]{4}[a-z]+$",data_reference) && !grepl("^@",data_reference)) {
12- ref <- split_cite_fun(data_reference)
13- } else {
14- bibs <- convert_to_bibtex(data_reference)
15- # Write new entries to library.bib
16- write_library(bibs)
17- ref <- get_bibtex_entries(bibs)
18- }
11+ ref <-
12+ if (grepl("^[a-zA-Z0-9]+[0-9]{4}[a-z]+$", data_reference) && !grepl("^@", data_reference)) {
13+ split_cite_fun(data_reference)
14+ } else {
15+ bibs <- convert_to_bibtex(data_reference)
16+ # Write new entries to library.bib
17+ write_library(bibs)
18+ get_bibtex_entries(bibs)
19+ }
1920
2021 if (ref != "") ref <- paste0(" ", ref)
2122
22- dataset_link <- if (!is.null(source_dataset_id) && dir.exists(paste0("../../datasets/", source_dataset_id))) {
23- glue::glue("../../datasets/{source_dataset_id}")
24- } else if (dir.exists(paste0("../../datasets/", dataset_id))) {
25- glue::glue("../../datasets/{dataset_id}")
26- } else {
27- NULL
28- }
23+ dataset_link <-
24+ if (!is.null(source_dataset_id) && dir.exists(paste0("../../datasets/", source_dataset_id))) {
25+ glue::glue("../../datasets/{source_dataset_id}")
26+ } else if (dir.exists(paste0("../../datasets/", dataset_id))) {
27+ glue::glue("../../datasets/{dataset_id}")
28+ } else {
29+ NULL
30+ }
2931
3032 # Make file_size human readable
3133 if (!is.null(file_size)) {
3234 file_size_str <- format(
33- structure(file_size, class = "object_size"),
34- units = "auto",
35- standard = "IEC",
36- digits = 2
35+ structure(file_size, class = "object_size"),
36+ units = "auto",
37+ standard = "IEC",
38+ digits = 2
3739 )
3840 }
3941
0 commit comments