Skip to content

Instantly share code, notes, and snippets.

View aaiezza's full-sized avatar

Alessandro Aiezza aaiezza

View GitHub Profile
@aaiezza
aaiezza / RNA-Seq_plotUtils.R
Created June 29, 2017 17:06
Miscellaneous functions used for plotting gene data.
#!/usr/bin/Rscript
suppressMessages( library( calibrate ) )
suppressMessages( library( ggplot2 ) )
suppressMessages( library( ggrepel ) )
suppressMessages( library( ggdendro ) )
suppressMessages( library( dendextend ) )
suppressMessages( require( htmlwidgets ) )
suppressMessages( require( gridExtra ) )
suppressMessages( require( plotly ) )
@aaiezza
aaiezza / plotNorm.R
Created June 27, 2017 14:15
ggplot2 plotting function for a Normal Distribution with lightly shaded and labeled standard deviations from the mean. User may also give lower and upper bounds, which adds shading under the curve between those points and a label with the area under the curve. (Made to accommodate for Mathematical Statistics with Applications 7th Ed. - WMS 2008)
##
# Standard function for printing Normal Distribution in ggplot2
# # # #
plotNormCurve <- function( mean = 0, sd = 1, variance = sd ^ 2,
lowerBound = NULL, upperBound = NULL,
sdRange = 3.5,
from = mean - (sdRange * sd),
to = mean + (sdRange * sd),
plotTitle = 'Normal Curve', xlab = 'x', ylab = 'density'
)