Skip to contents

The Data Exploration page's "Corr. Plot" (pairs plot with linear fits; needs the GGally package) and "Covariate Histograms", with one row per subject. They also work on a population from mvp_population(), e.g. to look at the sampled covariates.

Usage

mvp_corr_plot(data, columns, color = NULL)

mvp_hist_plot(data, columns, binwidth = 5)

Arguments

data

A data frame (e.g. from mvp_data() or mvp_population()), or the path of a file.

columns

Columns to plot.

color

Optional column to colour by (correlation plot).

binwidth

Width of the histogram bars.

Value

A ggplot (GGally ggmatrix for the correlation plot).

Examples

d <- data.frame(ID = 1:30, WT = seq(50, 108, 2), AGE = rep(c(30, 40, 50), 10))
mvp_hist_plot(d, c("WT", "AGE"), binwidth = 5)

if (requireNamespace("GGally", quietly = TRUE)) mvp_corr_plot(d, c("WT", "AGE"))