Skip to contents

Create individual correlation plots of selected variables

Usage

corrPlot(var, estimate_df, plot_df, output_dir)

Arguments

var

character string representing the variable

estimate_df

data frame containing the estimates

plot_df

data frame containing the plot

output_dir

character string representing the directory to save the plot.

Value

a ggplot2 plot saved to output_dir

Examples

var <- "example_var"
estimate_df <- data.frame(
    var = c("example_var", "example_var", "example_var"),
    age = c(20, 30, 40),
    estimate = c(0.5, 0.6, 0.7),
    p_adjust = c(0.01, 0.02, 0.03)
)
plot_df <- data.frame(
    age = c(20, 30, 40),
    example_var = c(1, 2, 3)
)
output_dir <- tempdir()
corrPlot(var, estimate_df, plot_df, output_dir)
#> `geom_smooth()` using formula = 'y ~ x'