diff --git a/DESCRIPTION b/DESCRIPTION index 86a2c93..c4b4e0f 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -4,7 +4,7 @@ Description: Suite of tools for data manipulation and calculations for Maryland DNR MBSS program. Includes functions for calculating FIBI, BIBI (MBSS genus), BIBI (MSW family), PHI, flow sums, ion contributions, and taxa distribution maps. -Version: 1.2.0 +Version: 1.2.0.9001 Authors@R: c( person("Erik W.", "Leppo", email="Erik.Leppo@tetratech.com", role=c("aut","cre")), person("Ann","Roseberry Lincoln", role="ctb"), diff --git a/NEWS b/NEWS index 1b87152..0a30175 100644 --- a/NEWS +++ b/NEWS @@ -3,7 +3,12 @@ NEWS-MBSStools - #> Last Update: 2024-04-05 16:00:44.873446 + #> Last Update: 2024-04-08 12:38:08.080495 + +# MBSStools v1.2.0.9001 (2024-04-08) + +- fix: Update examples and vignette to not use droplevels() + - Revised thresholds no longer has levels # MBSStools v1.2.0 (2024-04-05) diff --git a/NEWS.md b/NEWS.md index 1b87152..0a30175 100644 --- a/NEWS.md +++ b/NEWS.md @@ -3,7 +3,12 @@ NEWS-MBSStools - #> Last Update: 2024-04-05 16:00:44.873446 + #> Last Update: 2024-04-08 12:38:08.080495 + +# MBSStools v1.2.0.9001 (2024-04-08) + +- fix: Update examples and vignette to not use droplevels() + - Revised thresholds no longer has levels # MBSStools v1.2.0 (2024-04-05) diff --git a/NEWS.rmd b/NEWS.rmd index ad7b794..70c4bff 100644 --- a/NEWS.rmd +++ b/NEWS.rmd @@ -17,6 +17,11 @@ knitr::opts_chunk$set( cat(paste0("Last Update: ",Sys.time())) ``` +MBSStools v1.2.0.9001 (2024-04-08) +================ +* fix: Update examples and vignette to not use droplevels() + + Revised thresholds no longer has levels + MBSStools v1.2.0 (2024-04-05) ================ * refactor: Bump version number for fix in previous commit diff --git a/R/metric.scores.R b/R/metric.scores.R index f8db003..1405e30 100644 --- a/R/metric.scores.R +++ b/R/metric.scores.R @@ -31,8 +31,8 @@ #' # Thresholds #' thresh <- metrics_scoring #' # get metric names for myIndex -#' (myMetrics.Fish <- as.character(droplevels(unique(thresh[thresh[, -#' "Index.Name"]==myIndex,"MetricName.Other"])))) +#' (myMetrics.Fish <- as.character(unique(thresh[thresh[, +#' "Index.Name"] == myIndex,"MetricName.Other"]))) #' # Taxa Data #' myDF.Fish <- taxa_fish #' myMetric.Values.Fish <- metric.values(myDF.Fish, "fish", myMetrics.Fish, @@ -61,8 +61,8 @@ #' # Thresholds #' thresh <- metrics_scoring #' # get metric names for myIndex -#' (myMetrics.Bugs.MBSS <- as.character(droplevels(unique(thresh[thresh[, -#' "Index.Name"]==myIndex,"MetricName.Other"])))) +#' (myMetrics.Bugs.MBSS <- as.character(unique(thresh[thresh[, +#' "Index.Name"] == myIndex,"MetricName.Other"]))) #' # Taxa Data #' myDF.Bugs.MBSS <- taxa_bugs_genus #' myMetric.Values.Bugs.MBSS <- metric.values(myDF.Bugs.MBSS, "bugs", @@ -102,8 +102,8 @@ #' # Thresholds #' thresh <- metrics_scoring #' # get metric names for myIndex -#' (myMetrics.Bugs.MSW <- as.character(droplevels(unique(thresh[thresh[, -#' "Index.Name"]==myIndex,"MetricName.Other"])))) +#' (myMetrics.Bugs.MSW <- as.character(unique(thresh[thresh[, +#' "Index.Name"] == myIndex,"MetricName.Other"]))) #' # Taxa Data #' myDF.Bugs.MSW <- taxa_bugs_family #' myMetric.Values.Bugs.MSW <- metric.values(myDF.Bugs.MSW, "bugs", diff --git a/R/metric.values.R b/R/metric.values.R index 46bf4a4..a665426 100644 --- a/R/metric.values.R +++ b/R/metric.values.R @@ -97,8 +97,8 @@ #' # Thresholds #' thresh <- metrics_scoring #' # get metric names for myIndex -#' (myMetrics.Fish <- as.character(droplevels(unique(thresh[thresh[, -#' "Index.Name"]==myIndex,"MetricName.Other"])))) +#' (myMetrics.Fish <- as.character(unique(thresh[thresh[, +#' "Index.Name"] == myIndex,"MetricName.Other"]))) #' # Taxa Data #' myDF.Fish <- taxa_fish #' myMetric.Values.Fish <- metric.values(myDF.Fish, "fish", myMetrics.Fish) @@ -110,8 +110,8 @@ #' # Thresholds #' thresh <- metrics_scoring #' # get metric names for myIndex -#' (myMetrics.Bugs.MBSS <- as.character(droplevels(unique(thresh[thresh[, -#' "Index.Name"]==myIndex,"MetricName.Other"])))) +#' (myMetrics.Bugs.MBSS <- as.character(unique(thresh[thresh[, +#' "Index.Name"] == myIndex,"MetricName.Other"]))) #' # Taxa Data #' myDF.Bugs.MBSS <- taxa_bugs_genus #' myMetric.Values.Bugs.MBSS <- metric.values(myDF.Bugs.MBSS, "bugs", @@ -123,8 +123,8 @@ #' # Thresholds #' thresh <- metrics_scoring #' # get metric names for myIndex -#' (myMetrics.Bugs.MSW <- as.character(droplevels(unique(thresh[thresh[, -#' "Index.Name"]==myIndex,"MetricName.Other"])))) +#' (myMetrics.Bugs.MSW <- as.character(unique(thresh[thresh[, +#' "Index.Name"] == myIndex,"MetricName.Other"]))) #' # Taxa Data #' myDF.Bugs.MSW <- taxa_bugs_family #' myMetric.Values.Bugs.MSW <- metric.values(myDF.Bugs.MSW, "bugs", @@ -136,8 +136,7 @@ # myIndex <- "MBSS.2005.Fish" # thresh <- metrics_scoring # (myMetrics.Fish <- as.character( -# droplevels(unique(thresh[thresh[,"Index.Name"]== -# myIndex,"MetricName.Other"])))) +# unique(thresh[thresh[,"Index.Name"] == myIndex,"MetricName.Other"]))) # myDF <- taxa_fish # myDF.Fish # # myMetric.Values.Fish <- metric.values(myDF, "SampleID", "fish", # # myMetrics.Fish, TRUE) diff --git a/doc/MBSStools_vignette.R b/doc/MBSStools_vignette.R index 7b67668..eaf407e 100644 --- a/doc/MBSStools_vignette.R +++ b/doc/MBSStools_vignette.R @@ -14,7 +14,7 @@ myIndex <- "MBSS.2005.Fish" # Thresholds thresh <- metrics_scoring # get metric names for myIndex -(myMetrics.Fish <- as.character(droplevels(unique(thresh[thresh[,"Index.Name"]==myIndex,"MetricName.Other"])))) +(myMetrics.Fish <- as.character(unique(thresh[thresh[,"Index.Name"] == myIndex,"MetricName.Other"]))) # Taxa Data myDF.Fish <- taxa_fish myMetric.Values.Fish <- metric.values(myDF.Fish, "fish", myMetrics.Fish, TRUE) @@ -31,7 +31,7 @@ myIndex <- "MBSS.2005.Bugs" # Thresholds thresh <- metrics_scoring # get metric names for myIndex -(myMetrics.Bugs.MBSS <- as.character(droplevels(unique(thresh[thresh[,"Index.Name"]==myIndex,"MetricName.Other"])))) +(myMetrics.Bugs.MBSS <- as.character(unique(thresh[thresh[,"Index.Name"] == myIndex,"MetricName.Other"]))) # Taxa Data myDF.Bugs.MBSS <- taxa_bugs_genus myMetric.Values.Bugs.MBSS <- metric.values(myDF.Bugs.MBSS, "bugs", myMetrics.Bugs.MBSS) @@ -54,7 +54,7 @@ myIndex <- "MSW.1999.Bugs" # Thresholds thresh <- metrics_scoring # get metric names for myIndex -(myMetrics.Bugs.MSW <- as.character(droplevels(unique(thresh[thresh[,"Index.Name"]==myIndex,"MetricName.Other"])))) +(myMetrics.Bugs.MSW <- as.character(unique(thresh[thresh[,"Index.Name"] == myIndex,"MetricName.Other"]))) # Taxa Data myDF.Bugs.MSW <- taxa_bugs_family myMetric.Values.Bugs.MSW <- metric.values(myDF.Bugs.MSW, "bugs", myMetrics.Bugs.MSW) @@ -126,12 +126,12 @@ head(df.lu.taxa) ## ----TaxaMaps Example Code, eval=FALSE---------------------------------------- # # Set Working Directory # wd <- getwd() -# +# # # Inputs # Obs <- "AllFish_95to16.xls" # XWalk <- "TaxaMapsCrossWalk20170731.xlsx" # wd <- getwd() -# +# # # Create maps # MapTaxaObs(Obs, XWalk, wd, onlymatches = FALSE) @@ -170,7 +170,7 @@ xWalk <- "TaxaMapsCrossWalk20170731.xlsx" oldwd <- getwd() setwd("..") #resets to vignette dir when run as code chunk -dirMain <- getwd() +dirMain <- getwd() dirData = "Data" dirGIS = "GIS" verbose = TRUE @@ -228,7 +228,7 @@ taxon <- as.character(map.taxa$CommonName[i]) df.taxon.sites <- subset(df.taxa.obs, df.taxa.obs[,"CommonName"]==taxon) df.taxon.sites <- subset(df.taxon.sites, !is.na(df.taxon.sites["Latitude83"])) - + plot(state, col="white", border="gray") plot(coastline, add = TRUE, col="light blue", border=FALSE) plot(counties, add = TRUE, col="white", border="darkslategray", lwd=0.5) @@ -237,8 +237,8 @@ taxon <- as.character(map.taxa$CommonName[i]) "+proj=lcc +lat_1=39.45 +lat_2=38.3 +lat_0=37.66666666666666 +lon_0=-77 +x_0=400000 +y_0=0 +datum=NAD83 +units=m +no_defs") points(proj.sites[,1], proj.sites[,2], pch=21, col="black", bg="green", cex=1.0) - - + + #reset old working directory #setwd <- oldwd diff --git a/inst/shiny-examples/MBSStools/rsconnect/shinyapps.io/tetratech-wtr-wne/MBSStools.dcf b/inst/shiny-examples/MBSStools/rsconnect/shinyapps.io/tetratech-wtr-wne/MBSStools.dcf index 4ec9985..e566211 100644 --- a/inst/shiny-examples/MBSStools/rsconnect/shinyapps.io/tetratech-wtr-wne/MBSStools.dcf +++ b/inst/shiny-examples/MBSStools/rsconnect/shinyapps.io/tetratech-wtr-wne/MBSStools.dcf @@ -5,9 +5,7 @@ account: tetratech-wtr-wne server: shinyapps.io hostUrl: https://api.shinyapps.io/v1 appId: 2566633 -bundleId: 4773852 +bundleId: url: https://tetratech-wtr-wne.shinyapps.io/MBSStools/ -when: 1625071889.94754 -lastSyncTime: 1625071889.94754 asMultiple: FALSE asStatic: FALSE diff --git a/inst/shiny-examples/MBSStools/server.R b/inst/shiny-examples/MBSStools/server.R index facf50c..608e450 100644 --- a/inst/shiny-examples/MBSStools/server.R +++ b/inst/shiny-examples/MBSStools/server.R @@ -162,8 +162,8 @@ shinyServer(function(input, output) { #myIndex <- input$MMI thresh <- MBSStools::metrics_scoring - myMetrics <- as.character(droplevels(unique(thresh[thresh[ - ,"Index.Name"]==myIndex,"MetricName.Other"]))) + myMetrics <- as.character(unique(thresh[thresh[ + ,"Index.Name"] == myIndex,"MetricName.Other"])) # # myCommunity <- Community[match(myIndex, MMIs)] myCol_Strata <- col_Strata[match(myIndex, MMIs)] diff --git a/inst/shiny-examples/MBSStools/ui.R b/inst/shiny-examples/MBSStools/ui.R index 0d74990..6f15a5b 100644 --- a/inst/shiny-examples/MBSStools/ui.R +++ b/inst/shiny-examples/MBSStools/ui.R @@ -19,7 +19,7 @@ library(shinyjs) # used for togglestate of download button shinyUI(fluidPage( # Application title - titlePanel("MBSStools, IBI Calculator, v1.2.0"), + titlePanel("MBSStools, IBI Calculator, v1.2.0.9001"), # SideBar sidebarLayout( diff --git a/man/metric.scores.Rd b/man/metric.scores.Rd index 2faffa3..04744ae 100644 --- a/man/metric.scores.Rd +++ b/man/metric.scores.Rd @@ -45,8 +45,8 @@ myIndex <- "MBSS.2005.Fish" # Thresholds thresh <- metrics_scoring # get metric names for myIndex -(myMetrics.Fish <- as.character(droplevels(unique(thresh[thresh[, -"Index.Name"]==myIndex,"MetricName.Other"])))) +(myMetrics.Fish <- as.character(unique(thresh[thresh[, +"Index.Name"] == myIndex,"MetricName.Other"]))) # Taxa Data myDF.Fish <- taxa_fish myMetric.Values.Fish <- metric.values(myDF.Fish, "fish", myMetrics.Fish, @@ -75,8 +75,8 @@ myIndex <- "MBSS.2005.Bugs" # Thresholds thresh <- metrics_scoring # get metric names for myIndex -(myMetrics.Bugs.MBSS <- as.character(droplevels(unique(thresh[thresh[, -"Index.Name"]==myIndex,"MetricName.Other"])))) +(myMetrics.Bugs.MBSS <- as.character(unique(thresh[thresh[, +"Index.Name"] == myIndex,"MetricName.Other"]))) # Taxa Data myDF.Bugs.MBSS <- taxa_bugs_genus myMetric.Values.Bugs.MBSS <- metric.values(myDF.Bugs.MBSS, "bugs", @@ -116,8 +116,8 @@ myIndex <- "MSW.1999.Bugs" # Thresholds thresh <- metrics_scoring # get metric names for myIndex -(myMetrics.Bugs.MSW <- as.character(droplevels(unique(thresh[thresh[, -"Index.Name"]==myIndex,"MetricName.Other"])))) +(myMetrics.Bugs.MSW <- as.character(unique(thresh[thresh[, +"Index.Name"] == myIndex,"MetricName.Other"]))) # Taxa Data myDF.Bugs.MSW <- taxa_bugs_family myMetric.Values.Bugs.MSW <- metric.values(myDF.Bugs.MSW, "bugs", diff --git a/man/metric.values.Rd b/man/metric.values.Rd index 1881047..b39a109 100644 --- a/man/metric.values.Rd +++ b/man/metric.values.Rd @@ -115,8 +115,8 @@ myIndex <- "MBSS.2005.Fish" # Thresholds thresh <- metrics_scoring # get metric names for myIndex -(myMetrics.Fish <- as.character(droplevels(unique(thresh[thresh[, -"Index.Name"]==myIndex,"MetricName.Other"])))) +(myMetrics.Fish <- as.character(unique(thresh[thresh[, +"Index.Name"] == myIndex,"MetricName.Other"]))) # Taxa Data myDF.Fish <- taxa_fish myMetric.Values.Fish <- metric.values(myDF.Fish, "fish", myMetrics.Fish) @@ -128,8 +128,8 @@ myIndex <- "MBSS.2005.Bugs" # Thresholds thresh <- metrics_scoring # get metric names for myIndex -(myMetrics.Bugs.MBSS <- as.character(droplevels(unique(thresh[thresh[, -"Index.Name"]==myIndex,"MetricName.Other"])))) +(myMetrics.Bugs.MBSS <- as.character(unique(thresh[thresh[, +"Index.Name"] == myIndex,"MetricName.Other"]))) # Taxa Data myDF.Bugs.MBSS <- taxa_bugs_genus myMetric.Values.Bugs.MBSS <- metric.values(myDF.Bugs.MBSS, "bugs", @@ -141,8 +141,8 @@ myIndex <- "MSW.1999.Bugs" # Thresholds thresh <- metrics_scoring # get metric names for myIndex -(myMetrics.Bugs.MSW <- as.character(droplevels(unique(thresh[thresh[, -"Index.Name"]==myIndex,"MetricName.Other"])))) +(myMetrics.Bugs.MSW <- as.character(unique(thresh[thresh[, +"Index.Name"] == myIndex,"MetricName.Other"]))) # Taxa Data myDF.Bugs.MSW <- taxa_bugs_family myMetric.Values.Bugs.MSW <- metric.values(myDF.Bugs.MSW, "bugs",