Skip to content

Commit

Permalink
v2.1.0.9010
Browse files Browse the repository at this point in the history
- refactor: Add summation of duplicate taxa in taxa translate in Shiny
  • Loading branch information
leppott committed Aug 6, 2024
1 parent 0d1b498 commit 665b577
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 6 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: BCGcalc
Type: Package
Title: Biological Condition Gradient, calculator
Version: 2.1.0.9008
Version: 2.1.0.9010
Authors@R: c(
person("Erik W.", "Leppo", email="Erik.Leppo@tetratech.com", role=c("aut","cre")),
person("Jen", "Stamp", email="Jen.Stamp@tetratech.com", role="ctb"),
Expand Down
17 changes: 15 additions & 2 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
BCGcalc-NEWS
================
<Erik.Leppo@tetratech.com>
2024-07-24 21:12:35.715856
2024-08-06 11:28:24.889548

<!-- NEWS.md is generated from NEWS.Rmd. Please edit that file -->

#> Last Update: 2024-07-24 21:12:35.737282
#> Last Update: 2024-08-06 11:28:24.909271

# BCGcalc 2.1.0.9010 (2024-08-06)

- refactor: Add summation of duplicate taxa in taxa translate in Shiny

# BCGcalc 2.1.0.9009 (2024-07-30)

- refactor: Merge Pull Request 92

# BCGcalc 2.1.0.9008 (2024-07-29)

- refactor: Update Rules.xlsx for MN_BCG metric descriptions and index
regions

# BCGcalc 2.1.0.9007 (2024-07-24)

Expand Down
17 changes: 15 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
BCGcalc-NEWS
================
<Erik.Leppo@tetratech.com>
2024-07-24 21:12:35.715856
2024-08-06 11:28:24.889548

<!-- NEWS.md is generated from NEWS.Rmd. Please edit that file -->

#> Last Update: 2024-07-24 21:12:35.737282
#> Last Update: 2024-08-06 11:28:24.909271

# BCGcalc 2.1.0.9010 (2024-08-06)

- refactor: Add summation of duplicate taxa in taxa translate in Shiny

# BCGcalc 2.1.0.9009 (2024-07-30)

- refactor: Merge Pull Request 92

# BCGcalc 2.1.0.9008 (2024-07-29)

- refactor: Update Rules.xlsx for MN_BCG metric descriptions and index
regions

# BCGcalc 2.1.0.9007 (2024-07-24)

Expand Down
8 changes: 8 additions & 0 deletions NEWS.rmd
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ knitr::opts_chunk$set(
cat(paste0("Last Update: ",Sys.time()))
```

# BCGcalc 2.1.0.9010 (2024-08-06)

* refactor: Add summation of duplicate taxa in taxa translate in Shiny

# BCGcalc 2.1.0.9009 (2024-07-30)

* refactor: Merge Pull Request 92

# BCGcalc 2.1.0.9008 (2024-07-29)

* refactor: Update Rules.xlsx for MN_BCG metric descriptions and index regions
Expand Down
2 changes: 1 addition & 1 deletion inst/shiny-examples/BCGcalc/global.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Shiny Global File

# Version ----
pkg_version <- "2.1.0.9008"
pkg_version <- "2.1.0.9010"

# Packages----
# nolint start
Expand Down
24 changes: 24 additions & 0 deletions inst/shiny-examples/BCGcalc/server.R
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,30 @@ shinyServer(function(input, output) {
, "Match_Official"
, sel_user_groupby)]
df_ttrm <- df_ttrm[, col_keep_ttrm]

### COMBINE same TaxaID and sum N_Taxa----
# 20240806 from MNcalc
boo_combine_taxa <- TRUE
if (boo_combine_taxa) {
# use 'known' values with tidyverse then change back
#
# name field to known value
col_ttrm_ntaxa <- "ttrm_ntaxa"
df_ttrm[, col_ttrm_ntaxa] <- df_ttrm[, sel_user_ntaxa]
col_non_ntaxa <- names(df_ttrm)[!names(df_ttrm) %in% sel_user_ntaxa]
# drop ntaxa
df_ttrm <- df_ttrm[, col_non_ntaxa]
# columns by (for summarize)
col_by <- col_non_ntaxa[!col_non_ntaxa %in% col_ttrm_ntaxa]
# sum
df_ttrm <- dplyr::summarise(df_ttrm
, .by = dplyr::all_of(col_by)
, sum_ntaxa = sum(ttrm_ntaxa, na.rm = TRUE)
)
# rename 'known' ntaxa back to 'user' value
names(df_ttrm)[names(df_ttrm) == "sum_ntaxa"] <- sel_user_ntaxa
}## boo_combine_taxa

# merge with attributes
df_merge_attr <- merge(df_ttrm
, df_taxoff_attr
Expand Down

0 comments on commit 665b577

Please sign in to comment.