An open API service indexing awesome lists of open source software.

https://github.com/jeffreypullin/prettygreta

A pretty frontend for greta
https://github.com/jeffreypullin/prettygreta

Last synced: about 1 year ago
JSON representation

A pretty frontend for greta

Awesome Lists containing this project

README

          

---
output: github_document
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
```

# prettygreta

A *very* experimental pretty front end for **greta**. **prettygreta** uses **rlang**
to construct formulas and do other NSE magic.

## Usage

```{r, usage}
suppressMessages(library(greta))
suppressMessages(library(prettygreta))

rating <- attitude$rating
complaints <- attitude$complaints

# The first example model from the greta website - but pretty...
int ~ N(0, 10)
coef ~ N(0, 10)
sd ~ HalfCauchy(0, 3)
mu = int + coef * complaints
rating ~ N(mu, sd)

m <- model(int, coef, sd)

# But we can still use normal formulas!

x <- 1:20
y <- 2 * x + rnorm(20)
fit <- lm(y ~ x)
fit

```

## Install

To install the package use:

```{r installation, eval = FALSE}
devtools::install_github("Voltemand/prettygreta")
```