luomus / finbif

@@ -234,7 +234,9 @@
Loading
234 234
      select <- unique(c(select, date_time_vars[[var_type]]))
235 235
    }
236 236
237 -
    vars <- c("abundance", "individualCount")
237 +
    vars <- c(
238 +
      "abundance", "individualCount", "occurrence_status", "occurrenceStatus"
239 +
    )
238 240
239 241
    abundance <- any(vars %in% select)
240 242

@@ -132,8 +132,6 @@
Loading
132 132
133 133
  df <- compute_abundance(df, select_, dwc)
134 134
135 -
  df <- compute_occurrence_status(df, select_, dwc)
136 -
137 135
  df <- coordinates_uncertainty(df, select_, dwc)
138 136
139 137
  df <- structure(
@@ -506,11 +504,13 @@
Loading
506 504
507 505
  abundance_ <- var_names[["computed_var_abundance", type]]
508 506
507 +
  occurrence_status_ <- var_names[["computed_var_occurrence_status", type]]
508 +
509 509
  abundance_i <- var_names[["unit.interpretations.individualCount", type]]
510 510
511 511
  abundance_v <- var_names[["unit.abundanceString", type]]
512 512
513 -
  if (abundance_ %in% select_) {
513 +
  if (abundance_ %in% select_ || occurrence_status_ %in% select_) {
514 514
515 515
    abundance <- ifelse(
516 516
      df[[abundance_i]] == 1L,
@@ -518,29 +518,21 @@
Loading
518 518
      df[[abundance_i]]
519 519
    )
520 520
521 -
    df[[abundance_]] <- abundance
521 +
    if (abundance_ %in% select_) {
522 522
523 -
  }
523 +
      df[[abundance_]] <- abundance
524 524
525 -
  df
526 -
527 -
}
528 -
529 -
#' @noRd
530 -
531 -
compute_occurrence_status <- function(df, select_, dwc) {
532 -
533 -
  type <- col_type_string(dwc)
534 -
535 -
  occurrence_status_ <- var_names[["computed_var_occurrence_status", type]]
525 +
    }
536 526
537 -
  abundance <- var_names[["computed_var_abundance", type]]
527 +
    if (occurrence_status_ %in% select_) {
538 528
539 -
  if (occurrence_status_ %in% select_) {
529 +
      occurrence_status <- ifelse(
530 +
        is.na(abundance) | abundance > 0L, "present", "absent"
531 +
      )
540 532
541 -
    occurrence_status <- ifelse(df[[abundance]] == 0L, "absent","present")
533 +
      df[[occurrence_status_]] <- occurrence_status
542 534
543 -
    df[[occurrence_status_]] <- occurrence_status
535 +
    }
544 536
545 537
  }
546 538
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