https://github.com/moodymudskipper/woof
wadlo's companion package
https://github.com/moodymudskipper/woof
Last synced: 2 days ago
JSON representation
wadlo's companion package
- Host: GitHub
- URL: https://github.com/moodymudskipper/woof
- Owner: moodymudskipper
- License: other
- Created: 2023-04-06T11:51:23.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-06T21:44:29.000Z (about 2 years ago)
- Last Synced: 2025-04-12T20:52:13.112Z (2 days ago)
- Language: R
- Size: 11.7 KB
- Stars: 7
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
- jimsghstars - moodymudskipper/woof - wadlo's companion package (R)
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```# woof
{woof} is {waldo}'s [companion](https://waldo.fandom.com/wiki/Woof).
* Given a "waldo_compare" object `woof::woof()` returns
a nested list easier to explore and programatically work with. Any subset
of the output prints like `waldo:compare()`'s output does.* `woof::woof_compare()` is a drop-in replacement for `waldo::compare()`, it prints
just the same but can be subsetted.## Installation
Install with:
``` r
devtools::install_github("moodymudskipper/woof")
```## Example
```{r example}
library(woof)# we build 2 different lists
foo <- list(
a = "b",
list(c = list("d"), x = "e"),
f = "g"
)
attr(foo$a, "my_attr") <- "attr1"bar <- list(
a = "B",
list(c = list("D"), x = "E")
)
attr(bar$a, "my_attr") <- "attr2"w <- woof_compare(foo, bar)
w # prints like waldo::compare's output
w$`2`
w$`1`$..attr
library(ggplot2)
p1 <- ggplot(cars, aes(speed, dist)) + geom_point()
p2 <- ggplot(cars, aes(speed, dist)) + geom_line()
w <- woof_compare(p1, p2)# the original output is huge, but we can navigate it easily with autocomplete
w$layers$`1`$geom_params
```