Package {metalabr}


Title: Access MetaLab Community-Augmented Meta-Analysis Data
Version: 1.0.0
Description: Read released, versioned data from MetaLab (https://metalab.stanford.edu), a database of community-augmented meta-analyses of language acquisition and cognitive development; validate candidate datasets against the MetaLab field specification; compute standardized effect sizes; and draw the standard MetaLab visualizations (scatter, violin, forest, and funnel plots) backed by multilevel random-effects models.
License: MIT + file LICENSE
URL: https://github.com/langcog/metalabr, https://metalab.stanford.edu
BugReports: https://github.com/langcog/metalabr/issues
Encoding: UTF-8
Imports: assertthat, dplyr, ggplot2, Hmisc, httr, jsonlite, magrittr, metafor, purrr, rlang, stringr, tibble, yaml
Suggests: knitr, readr, redivis, rmarkdown, testthat (≥ 3.0.0)
VignetteBuilder: knitr
Additional_repositories: https://langcog.r-universe.dev
Config/testthat/edition: 3
RoxygenNote: 7.3.3
NeedsCompilation: no
Packaged: 2026-09-28 05:51:36 UTC; mcfrank
Author: Erik Iverson [aut], Sara El-Shawa [aut], Michael C. Frank ORCID iD [aut, cre], MetaLab contributors [cph]
Maintainer: Michael C. Frank <mcfrank@stanford.edu>
Repository: CRAN
Date/Publication: 2026-10-08 17:30:07 UTC

metalabr: access MetaLab community-augmented meta-analysis data

Description

Read released, versioned MetaLab data (effect sizes from meta-analyses of language acquisition and cognitive development), validate candidate datasets against the MetaLab field specification, and draw the standard MetaLab visualizations. See https://metalab.stanford.edu.

Author(s)

Maintainer: Michael C. Frank mcfrank@stanford.edu (ORCID)

Authors:

Other contributors:

See Also

Useful links:


Get the current MetaLab data release

Description

Downloads the current release's effect-size data from the MetaLab site (no account or extra packages needed) and returns it as a data frame, one row per effect size across all datasets. The release name is announced with a message and attached as the metalab_release attribute.

Usage

get_current_metalab_data(rdata_file = get_current_data_url())

Arguments

rdata_file

URL or path of the data bundle; defaults to the bundle served by the MetaLab site.

Details

For versioned, pinnable access use get_metalab_data; for the dataset registry use get_metalab_metadata.

Value

A data frame (tibble) of effect sizes, or NULL (with a message) if the bundle could not be downloaded.

Examples


  metalab_data <- get_current_metalab_data()
  if (!is.null(metalab_data)) dim(metalab_data)


Get MetaLab effect-size data

Description

By default, reads a released version of the MetaLab database from Redivis (https://stanford.redivis.com/datasets/81tq-8dp5ge6b9) — one row per effect size across all datasets, with all coded and derived columns. Releases are versioned and citable; the release used is announced with a message.

Usage

get_metalab_data(
  metalab_metadata = NULL,
  short_names = NULL,
  domains = NULL,
  specs = NULL,
  perform_validation = TRUE,
  version = "current",
  imputation_seed = 111
)

Arguments

metalab_metadata

Optional data frame of dataset metadata (from get_metalab_metadata with a key column) to fetch live from Google Sheets. If omitted, released data are read from Redivis.

short_names

Optional character vector of dataset short names to include.

domains

Optional character vector of domains to include (mutually exclusive with short_names).

specs

Field specification (live-sheets path only); defaults to the current spec.

perform_validation

Whether to validate sheets before inclusion (live-sheets path only).

version

A MetaLab release name (e.g. "2026.1"), or "current" (default) for the latest release (Redivis path only).

imputation_seed

Seed used when imputing missing within-participant correlations (live-sheets path only). The default (111) is the value used to produce every released MetaLab dataset, so effect sizes reproduce the releases exactly; set to NULL to draw from the session's random number stream instead. The session's RNG state is saved and restored around the imputation either way.

Details

Passing metalab_metadata instead selects the legacy curator path: fetch the live Google Sheets listed in the metadata, validate them against the field spec, and compute effect sizes. This is how new data releases are produced and is subject to change between calls as curators edit sheets.

Value

A data frame (tibble) of effect sizes, or NULL (with a message) if released data could not be fetched.

Examples

## Not run: 
  # released data (recommended)
  metalab_data <- get_metalab_data()
  metalab_data <- get_metalab_data(version = "2023.1")
  mutex <- get_metalab_data(short_names = "mutex")

  # live curator sheets (legacy path)
  metadata <- get_metalab_metadata(dataset_file =
    "https://raw.githubusercontent.com/langcog/metalab/main/metadata/datasets.yaml")
  metalab_data <- get_metalab_data(metadata)

## End(Not run)

Get MetaLab dataset metadata

Description

By default, reads the dataset registry (one row per dataset: names, domains, citations, curators, summary counts, and data provenance) from the released MetaLab data on Redivis. Passing dataset_file instead parses a datasets.yaml registry file (the legacy curator path used to build releases).

Usage

get_metalab_metadata(dataset_file = NULL, version = "current")

Arguments

dataset_file

Optional path or URL of a datasets.yaml registry file; if provided, the registry is parsed from YAML instead of read from the released data.

version

A MetaLab release name (e.g. "2026.1"), or "current" (default) for the latest release (Redivis path only).

Value

A data.frame of MetaLab dataset metadata (moderators and subset are list-columns), or NULL (with a message) if released data could not be fetched.

Examples

## Not run: 
  metadata <- get_metalab_metadata()
  metalab_data <- get_metalab_data(metadata)

## End(Not run)


Get the mapping between MetaLab data releases and Redivis dataset versions

Description

Fetches the release registry served by the MetaLab site, falling back to a built-in copy if the site is unreachable.

Usage

get_metalab_versions()

Value

A list with elements current (release name) and releases (named list mapping release names to metadata including redivis_version).

Examples


  versions <- get_metalab_versions()
  versions$current


Forest plot with multilevel model estimates

Description

Observed effect sizes (with CIs, sized by precision) alongside the fitted estimates of the canonical MetaLab multilevel model.

Usage

metalab_forest_plot(
  metalab_data,
  short_name,
  es_col = "g_calc",
  es_var_col = "g_var_calc",
  moderators = NULL,
  sort_order = "effects",
  alpha = 0.05
)

Arguments

metalab_data

MetaLab effect-size data (from get_metalab_data).

short_name

A dataset short name.

es_col, es_var_col

Effect size and variance columns (e.g. "g_calc", "g_var_calc").

moderators

Optional character vector of moderator columns.

sort_order

One of "effects", "variances", "estimate", "study_ID", "year".

alpha

CI level (default 0.05 for 95% CIs).

Value

A ggplot object.


Funnel plot of bias in effect sizes

Description

With no moderators, a classic funnel (effect size against standard error, with 95% and 99% pseudo-confidence regions around the mean). With moderators, a residual funnel around zero.

Usage

metalab_funnel_plot(
  metalab_data,
  short_names,
  es_col = "g_calc",
  es_var_col = "g_var_calc",
  moderators = NULL
)

Arguments

metalab_data

MetaLab effect-size data (from get_metalab_data).

short_names

One or more dataset short names.

es_col

Effect size column (e.g. "g_calc").

es_var_col

Effect size variance column.

moderators

Optional character vector of moderator columns.

Value

A ggplot object.


Egger-style test for funnel-plot asymmetry

Description

Adds the square root of each effect size's variance as a fixed-effect moderator to the canonical multilevel model and reports its coefficient — the standard multilevel adaptation of Egger's regression test. (The legacy application attempted metafor::regtest(), which does not support multilevel models.)

Usage

metalab_funnel_test(
  metalab_data,
  short_names,
  es_col = "g_calc",
  es_var_col = "g_var_calc",
  moderators = NULL
)

Arguments

metalab_data

MetaLab effect-size data (from get_metalab_data).

short_names

One or more dataset short names.

es_col

Effect size column (e.g. "g_calc").

es_var_col

Effect size variance column.

moderators

Optional character vector of moderator columns.

Value

A one-row data.frame with columns z and p.


Scatter plot of effect sizes across age

Description

Effect sizes against mean participant age (months), with a weighted smoothing curve, colored by the selected categorical moderators.

Usage

metalab_scatter_plot(
  metalab_data,
  short_name,
  es_col = "g_calc",
  es_var_col = "g_var_calc",
  moderators = NULL,
  scatter_curve = "loess"
)

Arguments

metalab_data

MetaLab effect-size data (from get_metalab_data).

short_name

A dataset short name.

es_col, es_var_col

Effect size and variance columns (e.g. "g_calc", "g_var_calc").

moderators

Optional character vector of moderator columns.

scatter_curve

"loess" (default) or "lm"; smoothing is weighted by inverse variance.

Value

A ggplot object.


Violin plot of effect-size density

Description

Violin plot of effect-size density

Usage

metalab_violin_plot(
  metalab_data,
  short_names,
  es_col = "g_calc",
  moderators = NULL
)

Arguments

metalab_data

MetaLab effect-size data (from get_metalab_data).

short_names

One or more dataset short names.

es_col

Effect size column (e.g. "g_calc").

moderators

Optional character vector of moderator columns.

Value

A ggplot object.


Deprecated: interactive visualization app

Description

The Shiny applications formerly bundled with metalabr are superseded by the interactive visualizations on the MetaLab website, which run in the browser against released data.

Usage

viz_app(...)

Arguments

...

Ignored.

Value

Called for its message; returns NULL invisibly.