Skip to content

greta

0.6.0Package record

Simple and 'Scalable' Statistical Modelling in R

2packages dependsuggested by 1
2.1Kdownloads / year
84.7%test coverage
13/13flavors OK

Overview

About

Write statistical models in R and fit them by 'MCMC' and optimisation on 'CPUs' and 'GPUs', using Google 'TensorFlow'. 'greta' lets you write your own model like in 'BUGS', 'JAGS' and 'Stan', except that you write models right in R, it scales well to massive datasets, and it’s easy to extend and build on. See the website for more information, including tutorials, examples, package documentation, and the 'greta' forum. This work is discussed at Golding (2019) doi:10.21105/joss.01601.

Changes in 0.6.0

Changes

  • Add warmup information to the MCMC print method (#652, resolved by #755).
  • Cap TensorFlow's internal CPU threadpool inside vignette builds (via TF_NUM_INTRAOP_THREADS and TF_NUM_INTEROP_THREADS) so CRAN's CPU/elapsed timing on vignette rebuilds stays under the two-core limit (#796).
  • greta now also caps TensorFlow's CPU thread pools at 2 when running under R CMD check (detected via the _R_CHECK_LIMIT_CORES_ environment variable), so checks on CRAN machines respect the two-core limit (#796).
  • Reshaping a greta array with dim<- now keeps the ? placeholder display for unknown values instead of showing NA (#582).
  • Resolve issues with the TensorFlow version in DESCRIPTION: greta no longer requires == 2.16.0 and now accepts >= 2.16.0.
  • The n_cores argument now defaults to 2 cores and chains defaults to 2 chains; when the number of cores requested exceeds the number detected, the number detected is used.
  • Use .batch_size instead of batch_size internally, to avoid rare name clash errors (#634).
  • as.unknowns() now handles plain numeric vectors (and dim<- being set to NULL), fixing an mcmc() error "no applicable method for 'as.unknowns'" that surfaced when re-building vignettes under R-devel (#582).
  • greta_notes_tf_num_error() now emits its note with message() rather than cat(), so it can be silenced with suppressMessages() and is written to the message stream.
  • greta_sitrep() gains a verbosity argument with three levels of detail: "minimal" (default), "detailed", and "quiet" (#612, resolved by #679).
  • log.greta_array() now warns when the base argument is supplied, as it was being ignored (#597).
Show all changes in 0.6.0Hide the rest of the changes in 0.6.0
  • outer() (and %o%) now works with greta arrays when FUN = "*", instead of silently returning a base array of NAs; base R's "*" fast path used as.vector(), which dropped the greta operation (#582).

Installation and dependencies

  • greta now resolves its Python environment more flexibly instead of always forcing reticulate's managed (uv) environment: it respects a user-set RETICULATE_PYTHON, a stored greta preference, or an existing greta-env-tf2 conda environment, and otherwise uses the managed (uv) environment (#801).
  • The managed (uv) backend now works without an internet connection, by enabling uv's offline mode (via environment variable UV_OFFLINE) once reticulate's uv cache is installed. You can set UV_OFFLINE=0 (or =1) yourself to force online or offline resolution, respectively (#814).
  • Fixed library(greta) failing with an error when greta's stored Python preference file exists but is empty (#809).
  • greta_deps_spec() now only checks that the requested TensorFlow version is one greta supports (TensorFlow 2.16 and later are not supported, as they ship Keras 3); compatible TensorFlow Probability and Python versions are left to uv or conda to resolve rather than being validated against a fixed compatibility table (#675).
  • greta_list_py_modules() shows the Python packages installed in a specific TF2 environment (#801, #809).
  • greta_remove() consolidates greta's Python removal helpers behind a single what argument to remove the greta-env-tf2 conda environment, miniconda, reticulate's uv cache, the stored Python preference, the stored dependency versions, or all of them. This means destroy_greta_deps(), greta_remove_all_deps(), remove_greta_env(), remove_miniconda(), and remove_reticulate_uv_cache() are now superseded by greta_remove() (#814).
  • greta_remove() no longer leaves a stale, deleted environment active for the rest of the session: it now invalidates greta's cached Python backend and nudges you to restart R if you try to use greta again without restarting, instead of silently failing or falsely reporting the removed environment as still available.
  • greta_set_deps() persistently chooses which TensorFlow, TensorFlow Probability, and Python versions greta uses; the managed (uv) environment installs them on next load and install_greta_deps() uses them as its default; clear with greta_remove("deps") (#817).
  • greta_set_python() and greta_reset_python() let you choose, persistently, which Python environment greta uses - the managed (uv) environment (backend = "uv", the default), a conda environment (backend = "conda"), or a specific Python (backend = "path"); each reports the stored preference, warns if RETICULATE_PYTHON takes precedence, and shows what greta will resolve to on its next load (#801, #809, #817).
  • greta_set_python("path", path = ...) accepts either a Python binary or an environment directory (a virtualenv or conda prefix), looking for bin/python (or Scripts/python.exe on Windows) inside it, which eases offline and pre-installed setups (#814).
  • greta_sitrep() now reports the resolved Python backend and whether greta can start offline: for the managed (uv) environment, the UV_OFFLINE setting and whether reticulate's uv cache is populated; a missing conda environment is reported neutrally as "not used" on the managed (uv) backend rather than as a failure (#801, #817).
  • greta_sitrep() now requires Python 3.9 or later (previously 3.8), matching the Python versions greta supports (#809).
  • install_greta_deps() now records the location of the greta-env-tf2 conda environment at install time, so greta auto-detects it in any conda installation, not just reticulate's miniconda (#809).
  • install_greta_deps() is no longer required for most users, as greta now installs TensorFlow and TensorFlow Probability automatically via uv on first use; it remains for installing a conda environment (for example, for offline use), which you can then select with greta_set_python("conda") (#801).
  • install_greta_deps() now restores the warning.length option when it exits, instead of leaving its own value in place for the rest of the session.
  • reinstall_greta_env() and reinstall_miniconda() are now deprecated in favour of reinstall_greta_deps() (#814).
  • remove_greta_env(), remove_miniconda(), and remove_reticulate_uv_cache() ask for confirmation before removing, gain an ask argument (default interactive()) so they work non-interactively, and invisibly return whether anything was removed (#809).
  • remove_reticulate_uv_cache() removes reticulate's uv cache; note this cache is shared by all reticulate packages and is not greta-specific, and a system-wide uv cache is left untouched (#801, #809).

From NEWS.md in the release

Install

Health

CRAN checks
13OK
Slowest check: 6.0 min · r-oldrel-macos-x86_64
Status changes
  • OK13 OK2026-08-05
  • NOTE12 OK, 1 NOTE2026-08-01
  • OK6 OK2026-07-21
Advisories

none known

Documentation

In release 0.6.0
README· In the repository, left out of the releaseVignettesYes · 4 · dynamicNEWSYes · 100% structured · mentions 0.6.0Citation fileYes · cites a publicationWebsiteYes · pkgdown
Cites a JOSS paper
Help pages
49 (2 internal)includes a package overview page
Examples that run
21%6 run in a plain check · 23 never run
Exported functions with examples
63%
Documented parameters
93%
Return-value docs
97%
Help pages citing references
0%

Downloads

2.1K
CRAN downloads in the past year
Rank #4,549 · ~6/day · ~172/mo
Daily download trend is not available in this view yet.
79630 days
1.9K90 days
2.1K1 year
Compare downloads with other packages →
Also on241 r2u7 autocran844 conda_forge152 c2d4u

Repository

609Stars
67Forks
141Open issues
7Open PRs
12Releases
2,770Commits
21Commit identities
2,770 commits · Last activity 2026-10-23 · +0.5% stars, 30d · Default branch at 0.6.0.9000, ahead of CRAN 0.6.0 (checked 2026-10-22)
Responsiveness
How these are sampled
PRs merged (all time)
87%
Median days to close, 50 most recently updated closed issues
782
Median days to close, 50 most recently updated closed PRs
2

Stars over time

2026-07-21 · 6042026-10-24 · 609
PracticesBeta

16 development-tooling and community-health practices detected across 8 families in the upstream repository

Checks run against github.com/greta-dev/greta on 2026-10-22.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux, macOS and Windows

Governance and community (3)
Code of conductContributing guideIssue templates
Docs source (3)
pkgdown

GitHub Pages site last deployed 2026-10-14 · The repository has a site deploy workflow

pkgdown site last built 2026-07-21

Coverage (1)
Coverage reporting (Codecov)
Show all practicesHide 4 practices
Reproducibility and dev environment (1)
data-raw/
CRAN release process (1)
cran-comments.md
Research and citation (1)
codemeta.json
Lint, format, editor (4)
lintrAirVS CodeRStudio project
How this is detected·Detection ruleset v4 (2026-10-20)
AI coding toolsBeta

This repository shows signs of AI coding tools.

  • Claude Codefirst seen 2026-02-04
    Named in .Rbuildignore: .claude
    Named in .gitignore: .claude
    Pull request it wrote: opened by a project member
    Commits: at least 91 crediting it in the message
Models named in its commits
  • Claude Opus 564 commits · Aug to Sep 2026
  • Claude Opus 5.527 commits · Sep to Oct 2026
Counts are commits, not lines of code. Commits by a tool's accounts count once across all of its accounts. Commits crediting it are the largest count among its credit lines, a minimum.How this is detected·Detection ruleset v4 (updated 2026-09-27)

Dependencies

Declared dependencies
39 external dependencies (excludes base and recommended)

Installing greta adds 43 packages (19 with compiled code, 12 MB of source tarballs). Heaviest: tfruns 1.9 MB, Rcpp 1.8 MB, reticulate 1.6 MB.

Depends (1)
R >= 4.1.0
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
2direct
0indirect
Depends 2
Suggested by 1
Depends, Imports or LinkingTo, most downloaded first
Suggests, most downloaded first

Datasets

People & History

People (14)
Author, Maintainer since 0.4.1 (2022) · added in 0.4.1
Author, Copyright holder
Contributor · added in 0.3.0
Contributor · added in 0.3.0
Contributor · added in 0.3.0
Contributor · added in 0.3.0
Contributor · added in 0.4.1
Contributor · added in 0.3.0
Contributor · added in 0.3.0
Contributor · added in 0.3.0
Show 4 more contributorsHide 4 contributors
Contributor · added in 0.3.0
Contributor · added in 0.3.0
Contributor · added in 0.3.0
Contributor · added in 0.3.0

Previously maintained by Nick Golding (0.2.0 to 0.3.1).

Releases (11)

Pick two releases to compare their code metrics.

  • unarchivedReturned to CRAN
    2026-07-20
  • 0.6.0Latest
    record
    2026-07-20 · current release · diff ↗ ·
    removed 1 export
    are_null
    added 11 exports
    %o%, greta_list_py_modules, greta_remove, greta_remove_all_deps, greta_reset_python, greta_set_deps, greta_set_python, outer, py_module_available, py_version, remove_reticulate_uv_cache
  • R
    R 4.6.0 released · 2026-04-24
  • archivedRemoved from CRAN
    2025-09-20
    errors were not corrected despite reminders
  • R
    R 4.5.0 released · 2025-04-11
  • 0.5.0
    record
    2024-11-12 · diff ↗ ·
    removed 6 exports
    greta_notes_conda_create_error, greta_notes_conda_create_output, greta_notes_conda_install_error, greta_notes_conda_install_output, greta_notes_install_miniconda_error, greta_notes_install_miniconda_output
    added 18 exports
    adamax, are_null, as.greta_model, as.unknowns, cpu_only, destroy_greta_deps, gpu_only, greta_create_conda_env, greta_deps_receipt, greta_deps_spec, greta_install_miniconda, greta_set_install_logfile, is.greta_array, is.greta_mcmc_list, nadam, open_greta_install_log, run_optimiser, write_greta_install_log
  • R
    R 4.4.0 released · 2024-04-24
  • 0.4.5
    record
    2024-03-11 · diff ↗
  • 0.4.4
    record
    2024-02-02 · diff ↗
  • R
    R 4.3.0 released · 2023-04-21
  • 0.4.3
    record
    2022-09-08 · diff ↗ ·
    added 1 export
    reinstall_greta_deps
  • R
    R 4.2.0 released · 2022-04-22
  • 0.4.2
    record
    2022-03-22 · diff ↗
  • 0.4.1
    record
    2022-03-15 · diff ↗ ·
    added 17 exports
    chol2symm, cholesky_variable, greta_notes_conda_create_error, greta_notes_conda_create_output, greta_notes_conda_install_error, greta_notes_conda_install_output, greta_notes_install_miniconda_error, greta_notes_install_miniconda_output, greta_notes_tf_num_error, greta_sitrep, install_greta_deps, ordered_variable, reinstall_greta_env, reinstall_miniconda, remove_greta_env, remove_miniconda, simplex_variable
  • R
    R 4.1.0 released · 2021-05-18
  • R
    R 4.0.0 released · 2020-04-24
Show 7 earlier eventsHide 7 earlier events
  • 0.3.1
    record
    2019-08-09 · diff ↗
  • R
    R 3.6.0 released · 2019-04-26
  • 0.3.0
    record
    2018-10-30 · diff ↗ ·
    added 36 exports
    abind, adadelta, adagrad, adagrad_da, adam, apply, bfgs, calculate, cg, chol2inv, cobyla, cov2cor, eigen, extra_samples, ftrl, gradient_descent, hmc, identity, imultilogit, initials, joint, l_bfgs_b, mixture, momentum, nelder_mead, newton_cg, powell, proximal_adagrad, proximal_gradient_descent, rdist and 6 more
  • R
    R 3.5.0 released · 2018-04-23
  • 0.2.3
    record
    2018-01-23 · diff ↗ ·
    removed 1 export
    dynamics
    added 7 exports
    .internals, backsolve, colMeans, colSums, forwardsolve, rowMeans, rowSums
  • 0.2.0
    record
    2017-06-26
  • R
    R 3.4.0 released · 2017-04-21

Package metadata

First published
2017-06-26
Total releases
11 / 9 yrs
License
Apache License 2.0 OSI
Minimum R
≥ 4.1.0
Bundled data
0.5 KB / 1 file
Download size
1.2 MB

Cite

Cite this package

Run in R for the authors' entry:

citation("greta")

The package provides a citation file, so citation() returns the authors' own entry.

It points to 10.21105/joss.01601.

Cite the R Observatory

For a number measured here: a download total, a coverage figure, an archival date.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for greta version 0.6.0 [Data set]. HJJB, LLC. Data release v2026-10-24. https://doi.org/10.5281/zenodo.21843040

From data release v2026-10-24, which the citation names so these numbers can be found later. More on citing and the projects behind them.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy