knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

corrplot

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.

Installation

You can install the released version of corrplot from github with:

install.packages("devtools")
devtools::install_github("wu-2018/corrplot")

Example

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.



wu-2018/corrplot documentation built on Jan. 1, 2021, 12:52 p.m.