Skip to contents

This function incorporates most of the other functions in this package to plot a histogram of the data that includes the fit lines for each mode and the cutoff value depicted as a line. As a matter of course, this function runs the cleanData, datamodel, fit, curves, and findCutoff functions for you, negating the need to run those separately.

Usage

cutoffplot(
  x = cutoffvalue:::exampledata,
  title = "Plasma 11-KT levels in age-2 male spring chinook",
  xlab = "Plasma [11-KT] (ng/mL)",
  cutofflab = "Minijack cutoff",
  cutoffunits = "ng/mL",
  LowerMode_col = "red",
  LowerMode_lty = 1,
  LowerMode_lwd = 2,
  UpperMode_col = "purple",
  UpperMode_lty = 1,
  UpperMode_lwd = 2,
  cutoffvalue_col = "black",
  cutoffvalue_lty = 2,
  cutoffvalue_lwd = 2
)

Arguments

x

Your dataset specified as "DatasetName$ColumnName" or converted to a numeric list with a name (e.g., "yourrawdata <- as.numeric(yourrawdata$columnname)"). Regardless of how you import or specify it, data should be a single column of log-transformed data.

title

Title for the graph, default is blank

xlab

Label for the x-axis, default is "Plasma 11-KT (ng/mL)"

cutofflab

Label for the cutoff value, default is "Minijack cutoff"

cutoffunits

Label for the units, default is "ng/mL"

Value

Returns a histogram with colored lines depicting curves for upper and lower modes along with the determined cutoff line to delineate between the two modes. The cutoff value is also returned to the environment.

Examples

plotty <- cutoffplot(cutoffvalue:::exampledata, "Example Graph Title", "Example X-Axis", "Cutoff Label", "UNITS")
#> number of iterations= 21 

#> number of iterations= 15 

#> Cutoff Value: 0.1137313number of iterations= 19 


#> number of iterations= 21 

#> number of iterations= 18