Plots the selected continuous covariates correlations.

plot_covariates_correlations(run, covariates = NULL,
  baseline_only = TRUE, correlation_method = NULL, auto_order = TRUE,
  smoothing_method = NULL, smoothing_se = TRUE, type = "heatmap",
  fixed_ratio = TRUE, auto_legend = TRUE)

Arguments

run

pmxploit NONMEM run object.

covariates

character vector of continous covariates names. Default is NULL, returning all continuous covariates.

baseline_only

logical. Consider only the baseline (= first) values of the subjects. Default is TRUE.

correlation_method

a character string indicating which correlation coefficient (or covariance) is to be computed. One of "pearson" (default), "kendall", or "spearman": can be abbreviated. If type = "scatterplot", "pearson" method will be used.

auto_order

logical. If type = "heatmap", auto-orders the matrix with respect to the distances between values. Default is TRUE.

smoothing_method

character. If type = "scatterplot", corresponds to a ggplot2 smoothing method.

smoothing_se

logical. Display confidence interval around smooth?

type

character. Type of plot. One of heatmap or scatterplot.

fixed_ratio

logical. If type = "heatmap", plot scaled to a 1:1 ratio. Default is TRUE.

auto_legend

logical. When TRUE (default), default pmxploit plotting options are applied (title, labels, axis...).

split_by

character. If type = "scatterplot", categorical covariate name to colour observations by group.

Value

A a ggplot2 object.

Examples

cov <- c("AGE", "WT", "BSLDLC", "FBSPCSK", "TBSPCSK", "CLCR") EXAMPLERUN %>% plot_covariates_correlations(covariates = cov, type = "heatmap")+ ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 45, hjust = 1), legend.position = "bottom")
EXAMPLERUN %>% plot_covariates_correlations(covariates = cov, type = "heatmap", auto_order = FALSE)+ ggplot2::theme(axis.text.x = ggplot2::element_text(angle = 45, hjust = 1), legend.position = "bottom")
EXAMPLERUN %>% plot_covariates_correlations(covariates = c("AGE", "CLCR"), type = "scatterplot", smoothing_method = "lm")
#> Error: `data` must be a data frame, or other object coercible by `fortify()`, not a logical vector
EXAMPLERUN %>% plot_covariates_correlations(covariates = cov, type = "scatterplot")
EXAMPLERUN %>% plot_covariates_correlations(covariates = cov, type = "scatterplot", smoothing_method = "lm")
#> Error: `data` must be a data frame, or other object coercible by `fortify()`, not a logical vector
EXAMPLERUN %>% plot_covariates_correlations(covariates = cov, type = "scatterplot", smoothing_method = "loess")
#> Error: `data` must be a data frame, or other object coercible by `fortify()`, not a logical vector
EXAMPLERUN %>% group_by(STUD) %>% plot_covariates_correlations(covariates = cov, type = "scatterplot")
#> Warning: Factor variables are omitted in plot