corr_plot: A function that generates a correlation plot for a list of...

Description Usage Arguments Value Examples

View source: R/corr_plot.R

Description

A function that generates a correlation plot for a list of features in a given data frame.

Usage

1
corr_plot(data, features = NULL, method = "pearson")

Arguments

data

The input data frame for plotting.

features

A vector of characters that represents the features names. By default, NULL (returns plot of all numeric features).

method

The correlation method that includes: 'pearson', 'spearman' or 'kendall'. By default 'pearson'.

Value

ggplot object, a correlation plot that illustrates the correlation between numeric features interactively.

Examples

1
2
3
4
5
6
7
data <- data.frame('Title' =
(c("Finding Nemo", "Dunkirk", "Denial")),
 'vote_average' = (c(3.86, 4.11, 3.62)),
  'vote_count'= (c(33887, 282, 68)), 'vote_std'= (c(0.87, 0.78, 0.82)))
numerical_features <- c('vote_average','vote_count','vote_std')

corr_plot(data, features = numerical_features, method = 'spearman')

UBC-MDS/eaziReda documentation built on March 24, 2021, 2:22 a.m.