plot_residual_histograms: Plotting of histograms of residuals to visualize the...

View source: R/plot_residual_histograms.R

plot_residual_histogramsR Documentation

Plotting of histograms of residuals to visualize the normality assumption

Description

Plotting of histograms of residuals to visualize the normality assumption

Usage

plot_residual_histograms(
  data,
  raw = FALSE,
  MOR = TRUE,
  groups = "Comparison",
  method = "SNRR",
  units = "mmol/L",
  studentize = TRUE,
  include_curve = TRUE,
  save = FALSE,
  save_path = getwd(),
  save_name = "Auto",
  save_device = "pdf",
  size = 8
)

Arguments

data

A data table or data frame with data generated from residual_histogram_data, where Comparison, residuals, standardized_residuals and more are included. If raw data of type LFDT is the input, it will be converted to residual histo gram data. To allow such transformation set raw to TRUE, and use MOR and groups argument to control the transformation

raw

Is data raw, or is it on the appropriate form described in the data argument

MOR

Is your data table containing mean of replicates? Only need to specify if raw = TRUE

groups

What are the grouping column names? Only need to specify if raw = TRUE

method

What method should be used to calculate the optimal bandwidths

units

The units of the analyte considered. These are included in the x-axis and y-axis names of the plots

studentize

Should we studentize the raw residuals. Default is TRUE. If TRUE, you may choose if a N(0,1) density curve should be drawn. This may be triggered by setting include_curve = TRUE

include_curve

Should a density curve of a N(0,1) be displayed over the histogram to visualize the assumed normality. Only relevant if studentize = TRUE

save

Save plot to disk. Default is FALSE. If TRUE, you may specify saving location, file and other with the next four parameters

save_path

Saving location given by a string. Default is the working directory

save_name

Name of the plot used to save. If save_name = 'Auto', a generic name is used based on data

save_device

What file do you want to save the plot as. Valid inputs are 'pdf', 'png', 'jpeg', and more. Using 'png' will produce plots with retina dpi

size

What should the size of the saved plot be? The number specified is the height of the plot. The width of the plot is calculated based on this and the golden ratio

Value

A plot (ggplot2 object) based on data

Examples

print(1)

pernille267/commutability.selectivity documentation built on July 20, 2022, 9:11 a.m.