luomus / finbif

@@ -187,6 +187,8 @@
Loading
187 187
    "gathering.interpretations.coordinateAccuracy", "document.sourceId"
188 188
  )
189 189
190 +
  citation_vars <- c("document.documentId", "document.sourceId")
191 +
190 192
  if (missing(select)) {
191 193
192 194
    select <- row.names(default_vars)
@@ -258,6 +260,18 @@
Loading
258 260
259 261
    }
260 262
263 +
    vars <- c("citation", "bibliographicCitation")
264 +
265 +
    citation <- any(vars %in% select)
266 +
267 +
    if (citation) {
268 +
269 +
      select <- unique(
270 +
        c(select, var_names[citation_vars, var_type])
271 +
      )
272 +
273 +
    }
274 +
261 275
    select_vars <- var_names[var_names[[select_type]], var_type, drop = FALSE]
262 276
    class(select_vars[[var_type]]) <- class(var_names[[var_type]])
263 277
    select <- translate(

@@ -132,6 +132,8 @@
Loading
132 132
133 133
  df <- compute_abundance(df, select_, dwc)
134 134
135 +
  df <- compute_citation(df, select_, dwc, record_id)
136 +
135 137
  df <- coordinates_uncertainty(df, select_, dwc)
136 138
137 139
  df <- structure(
@@ -551,6 +553,34 @@
Loading
551 553
552 554
#' @noRd
553 555
556 +
compute_citation <- function(df, select_, dwc, record_id) {
557 +
558 +
  type <- col_type_string(dwc)
559 +
560 +
  citation <- var_names[["computed_var_citation", type]]
561 +
562 +
  source <- var_names[["document.sourceId", type]]
563 +
564 +
  document_id <- var_names[["document.documentId", type]]
565 +
566 +
  if (citation %in% select_) {
567 +
568 +
    df[[citation]] <- ifelse(
569 +
      df[[source]] == "http://tun.fi/KE.3",
570 +
      df[[document_id]],
571 +
      record_id
572 +
    )
573 +
574 +
    df[[citation]] <- paste(df[[citation]], "Source: FinBIF")
575 +
576 +
  }
577 +
578 +
  df
579 +
580 +
}
581 +
582 +
#' @noRd
583 +
554 584
coordinates_uncertainty <- function(df, select_, dwc) {
555 585
556 586
  type <- col_type_string(dwc)
Files Coverage
R 100.00%
Project Totals (19 files) 100.00%

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading