BCG.Metric.Membership: BCG Metric Membership

Description Usage Arguments Details Value Examples

Description

Biological Condition Gradient fuzzy membership for metrics.

Usage

1
BCG.Metric.Membership(df.metrics, df.rules, input.shape = "wide")

Arguments

df.metrics

Wide data frame with metric values to be evaluated.

df.rules

Data frame of metric thresholds to check.

input.shape

Shape of df.metrics; wide or long. Default is wide.

Details

Converts metric values into BCG membership values. Uses a rules table to define the metrics, scoring range, and direction for each named index.

Value

Returns a data frame of results in the long format.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
library(readxl)
library(BioMonTools)

# Calculate Metrics
df.samps.bugs <- read_excel(system.file("./extdata/Data_BCG_PacNW.xlsx"
                                        , package="BCGcalc")
                           , guess_max = 10^6)
myDF <- df.samps.bugs
myCols <- c("Area_mi2", "SurfaceArea", "Density_m2", "Density_ft2", "Site_Type")
df.metric.values.bugs <- metric.values(myDF, "bugs", fun.cols2keep=myCols)

# Import Rules
df.rules <- read_excel(system.file("./extdata/Rules.xlsx"
                             , package="BCGcalc"), sheet="BCG_PacNW_v1_500ct") 

# Run function
df.Metric.Membership <- BCG.Metric.Membership(df.metric.values.bugs, df.rules)

## Not run: 
# Show Results
#View(df.Metric.Membership)

# Save Results
write.table(df.Metric.Membership, "Metric.Membership.tsv"
              , row.names=FALSE, col.names=TRUE, sep="\t")

## End(Not run)

leppott/BCGcalc documentation built on June 29, 2019, 10:41 a.m.