
Transform PSCIS Assessment Worksheet Data by Calculating All Metrics, Scores, and Results Necessary for Barrier Risk Assessment
Source:R/fpr_xfm_paw_all_scores_result.R
fpr_xfm_paw_all_scores_result.RdThis function calculates the fall metrics, scores, and results for BC Provincial Stream Crossing Inventory System (PSCIS) data, sums score columns, and assigns `barrier_result`.
Value
[dataframe] A dataframe with all calculated metrics, scores, and results necessary for barrier risk assessment.
Examples
path <- system.file("extdata", "pscis_phase1.xlsm", package = "fpr")
dat <- fpr_import_pscis(dir_root = fs::path_dir(path))
#> Warning: There was 1 warning in `dplyr::mutate()`.
#> ℹ In argument: `dplyr::across(dplyr::all_of(sig_fig0), round, 0)`.
#> Caused by warning:
#> ! The `...` argument of `across()` is deprecated as of dplyr 1.1.0.
#> Supply arguments directly to `.fns` through an anonymous function instead.
#>
#> # Previously
#> across(a:b, mean, na.rm = TRUE)
#>
#> # Now
#> across(a:b, \(x) mean(x, na.rm = TRUE))
#> ℹ The deprecated feature was likely used in the fpr package.
#> Please report the issue at
#> <https://github.com/NewGraphEnvironment/fpr/issues>.
result <- fpr_xfm_paw_all_scores_result(dat)
head(result[, grep("score|barrier", names(result), ignore.case = TRUE)])
#> # A tibble: 6 × 7
#> culvert_length_score embed_score outlet_drop_score culvert_slope_score
#> <dbl> <dbl> <dbl> <dbl>
#> 1 3 10 5 10
#> 2 0 10 0 5
#> 3 3 10 0 5
#> 4 6 10 0 5
#> 5 3 10 10 10
#> 6 6 10 5 0
#> # ℹ 3 more variables: stream_width_ratio_score <dbl>, final_score <dbl>,
#> # barrier_result <chr>