ggplot_ghistogram: Histogram of the g/tweak vector

View source: R/function_plotTweakHist.R

ggplot_ghistogramR Documentation

Histogram of the g/tweak vector

Description

The resulting distribution of g is visualized best in a histogram. As the g vector may get spread over a big range, you can provide a transformation function. This will be applied on the g/tweak vector. If the provided transformation function returns NA, the function will state the number of NAs in the title of the plot. For an example see section "Histogram of g-vector" in the package vignette 'browseVignettes("DTD")'

Usage

ggplot_ghistogram(
  DTD.model,
  n.bins = NA,
  G.TRANSFORM.FUN = log10p1,
  title = "",
  x.lab = "log10(g+1)"
)

Arguments

DTD.model

either a numeric vector with length of nrow(X), or a list returned by train_deconvolution_model, DTD_cv_lambda_cxx, or descent_generalized_fista. In the equation above the DTD.model provides the vector g.

n.bins

: positive integer, number of bins in the histogram

G.TRANSFORM.FUN

function, that expects a vector of numerics, and returns a vector of the same length. Will be applied on each intermediate 'g' vector. Set 'G.TRANSFORM.FUN' to identity if no transformation is required. If you change 'G.TRANSFORM.FUN' don't forget to adjust the 'x.lab' parameter.

title

string, additionally title

x.lab

string, used as x label on the plot

Value

ggplot object


MarianSchoen/DTD documentation built on April 29, 2022, 1:59 p.m.