R/sumstats_munged_example_input.R

Defines functions sumstats_munged_example_input

Documented in sumstats_munged_example_input

#' Example munged dataframe - refer to ldscr R package (https://github.com/mglev1n/ldscr)
#'
#' @param dataframe (logical) If `TRUE` (default), return an example munged dataframe. If `FALSE`, return path to the file on disk.
#' @param example (character) "401.1" which have been included as example traits.
#' @return either a [tibble][tibble::tibble-package] containing a munged dataframe, or a path to the file on disk.
#'
#' @export

sumstats_munged_example_input <- function(example, dataframe = TRUE) {
  if (dataframe) {
    vroom::vroom(fs::path(fs::path_package("extdata", paste0(example, ".sumstats.gz"), package = "pleioh2g")), col_types = vroom::cols())
  } else {
    fs::path(fs::path_package("extdata", paste0(example, ".sumstats.gz"), package = "pleioh2g"))
  }
}

Try the pleioh2g package in your browser

Any scripts or data that you put into this service are public.

pleioh2g documentation built on March 9, 2026, 5:07 p.m.