knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "man/figures/README-", out.width = "100%" )
The purpose of corrplot
is to provide a easy way for exploring the relationship between two variables. It will plot a scatter plot and show the correlation coefficients.
You can install the released version of corrplot
from github with:
install.packages("devtools") devtools::install_github("wu-2018/corrplot")
library(corrplot)
Use the iris dataset for example:
correlation_scatter(datasets::iris, x='Sepal.Length', y='Sepal.Width', group='Species', cor_method = "pearson")
It creates a scatter plot showing the relationship between Sepal.Length
and Sepal.Length
, grouped by the factor Species
. Note the correlation coefficients are annotated.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.