Plot a histogram with a boxplot below
Plots a histogram with a boxplot below
hist_boxplot( x, freq = TRUE, density = FALSE, main = NULL, xlab = NULL, ymax = NULL, col.hist = "lightblue", col.boxplot = "lightblue", ... )
x
: a numeric vectorfreq
: boolean, TRUE
for frequency or FALSE
probability on the y axisdensity
: boolean, TRUE
to plot the estimated densitymain
: character string, main title of the histogramxlab
: character string, label of the x axisymax
: numeric value, maximum of the y axiscol.hist
: color of the histogramcol.boxplot
: color of the boxplot...
: other arguments to be passed in hist()
None
par(mfrow=c(1,2)) hist_boxplot(rnorm(100),col.hist="lightblue",col.boxplot="red",freq=TRUE) hist_boxplot(rnorm(100),col.hist="lightblue",col.boxplot="red",freq=FALSE,density=TRUE)
Hugo Varet
Useful links