leppott / MBSStools

Suite of tools for data manipulation and calculations for Maryland DNR MBSS program.
https://leppott.github.io/MBSStools/
GNU General Public License v3.0
3 stars 3 forks source link

metric.values has error in R v4.0 #28

Closed leppott closed 4 years ago

leppott commented 4 years ago

Describe the bug Calculating metrics for fish results in error and no calculation.

To Reproduce Run example code in metric.values and get error.

# Metrics, MBSS Index, Fish
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"]))))
# Taxa Data
myDF.Fish <- taxa_fish
myMetric.Values.Fish <- metric.values(myDF.Fish, "fish", myMetrics.Fish)
View(myMetric.Values.Fish)

Expected behavior Should run without error.

Screenshots If applicable, add screenshots to help explain your problem. image

Additional context Did not test other R versions.

Sessioninfo below. image

leppott commented 4 years ago

image

leppott commented 4 years ago

Fails when try to add values to be used for adjusted metrics.

image

leppott commented 4 years ago

Convert met.val to data frame right after it is created.

image