luomus / finbif
Showing 1 of 1 files from the diff.

@@ -463,38 +463,43 @@
Loading
463 463
464 464
compute_epsg <- function(df, select_, dwc) {
465 465
466 -
  select_ <- var_names[, col_type_string(dwc)] %in% select_
466 +
  select_ <- match(select_, var_names[, col_type_string(dwc)])
467 467
468 468
  select_ <- row.names(var_names[select_, ])
469 469
470 -
  epsg <- c("euref", "kkj", "wgs84")
470 +
  crs <- c(computed_var_epsg = "", computed_var_fp_epsg = "footprint")
471 471
472 -
  names(epsg) <- epsg
472 +
  for (i in seq_along(crs)) {
473 473
474 -
  epsg[] <- paste0("_", epsg, "$")
474 +
    epsg <- c("euref", "kkj", "wgs84")
475 475
476 -
  epsg <- lapply(epsg, grepl, var_names[select_, "translated_var"])
476 +
    names(epsg) <- epsg
477 477
478 -
  epsg <- lapply(epsg, c, TRUE)
478 +
    epsg[] <- paste0(crs[[i]], "_", epsg, "$")
479 479
480 -
  epsg <- lapply(epsg, which)
480 +
    epsg <- lapply(epsg, grepl, var_names[select_, "translated_var"])
481 481
482 -
  epsg <- vapply(epsg, min, integer(1L), USE.NAMES = TRUE)
482 +
    epsg <- lapply(epsg, c, TRUE)
483 483
484 -
  epsg <- names(which.min(epsg))
484 +
    epsg <- lapply(epsg, which)
485 485
486 -
  epsg <- switch(
487 -
    epsg,
488 -
    euref = "EPSG:3067", kkj = "EPSG:2393", wgs84 = "EPSG:4326", NA_character_
489 -
  )
486 +
    epsg <- vapply(epsg, min, integer(1L), USE.NAMES = TRUE)
487 +
488 +
    epsg <- names(which.min(epsg))
490 489
491 -
  epsg <- rep_len(epsg, nrow(df))
490 +
    epsg <- switch(
491 +
      epsg,
492 +
      euref = "EPSG:3067",
493 +
      kkj = "EPSG:2393",
494 +
      wgs84 = "EPSG:4326",
495 +
      NA_character_
496 +
    )
492 497
493 -
  df[[var_names[["computed_var_epsg", col_type_string(dwc)]]]] <- epsg
498 +
    epsg <- rep_len(epsg, nrow(df))
494 499
495 -
  epsg <- rep_len("EPSG:4326", nrow(df))
500 +
    df[[var_names[[names(crs)[[i]], col_type_string(dwc)]]]] <- epsg
496 501
497 -
  df[[var_names[["computed_var_fp_epsg", col_type_string(dwc)]]]] <- epsg
502 +
  }
498 503
499 504
  df
500 505
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