Description Usage Arguments Details Note Author(s) See Also Examples
Draw a X Y scatter plot with associated X and Y histograms with estimated densities. Partly a demonstration of the use of layout. Also includes lowess smooth or linear model slope, as well as correlation. Adapted from addicted to R example 78
1 2 |
x |
The X vector, or the first column of a data.frame or matrix. |
y |
The Y vector, of if X is a data.frame or matrix, the second column of X |
smooth |
if TRUE, then loess smooth it |
ab |
if TRUE, then show the best fitting linear fit |
correl |
TRUE: Show the correlation |
density |
TRUE: Show the estimated densities |
ellipse |
TRUE: draw 1 and 2 sigma ellipses and smooth |
digits |
How many digits to use if showing the correlation |
method |
Which method to use for correlation ("pearson","spearman","kendall") defaults to "pearson" |
cex.cor |
Adjustment for the size of the correlation |
xlab |
Label for the x axis |
ylab |
Label for the y axis |
title |
An optional title |
... |
Other parameters for graphics |
Just a straightforward application of layout and barplot, with some tricks taken from pairs.panels
. The various options allow for correlation ellipses (1 and 2 sigma from the mean), lowess smooths, linear fits, density curves on the histograms, and the value of the correlation. ellipse = TRUE implies smooth = TRUE )
Adapted from Addicted to R example 78
William Revelle
pairs.panels
for multiple plots, multi.hist
for multiple histograms.
1 2 3 4 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.