Skip to content
/ plots.r Public

Generate beautiful forest plots with ease

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

GMELab/plots.r

Repository files navigation

plots.r

Installation

You can install the development version of plots.r like so:

install.packages("https://github.com/GMELab/plots.r/archive/refs/heads/master.tar.gz", repos=NULL) # use .zip for Windows
# OR
devtools::install_github("GMELab/plots.r")

Usage

plots.r::basic_forest_plot

plots.r::basic_forest_plot(
    x = x,
    se = se,
    width = width, # you will need to mess around with this to get it to look right
    height = height, # you will need to mess around with this to get it to look right
    name = name,
    header = c(left_header, right_header),
    slab = data_labels,
    xlab = x_axis_label,
    # other arguments from https://wviechtb.github.io/metafor/reference/forest.default.html
)

# Example
plots.r::basic_forest_plot(
    x = c(0.1, 0.2, 0.3, 0.4, 0.5),
    se = c(0.01, 0.02, 0.03, 0.04, 0.05),
    width = 500,
    height = 300,
    name = "Example",
    header = c("Left", "Right"),
    slab = c("Study 1", "Study 2", "Study 3", "Study 4", "Study 5"),
    xlab = "X-axis label",
    # other arguments from https://wviechtb.github.io/metafor/reference/forest.default.html
)

Example forest plot

plots.r::grouped_forest_plot

plots.r::grouped_forest_plot(
    x = x, # a list of vectors
    se = se, # a list of vectors
    width = width, # you will need to mess around with this to get it to look right
    height = height, # you will need to mess around with this to get it to look right
    name = name,
    header = c(left_header, right_header),
    slab = data_labels,
    xlab = x_axis_label,
    glab = group_labels,
    # other arguments from https://wviechtb.github.io/metafor/reference/forest.default.html
)

# Example
plots.r::grouped_forest_plot(
    x = list(c(0.1, 0.2, 0.3, 0.4, 0.5), c(0.1, 0.2, 0.3, 0.4, 0.5)),
    se = list(c(0.01, 0.02, 0.03, 0.04, 0.05), c(0.01, 0.02, 0.03, 0.04, 0.05)),
    width = 500,
    height = 500,
    name = "Grouped_Example",
    header = c("Left", "Right"),
    slab = c("Study 1", "Study 2", "Study 3", "Study 4", "Study 5"),
    xlab = "X-axis label",
    glab = c("Group 1", "Group 2"),
    # other arguments from https://wviechtb.github.io/metafor/reference/forest.default.html
)

Example forest plot

About

Generate beautiful forest plots with ease

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages