grantmcdermott / grantmcdermott/tinyplot

Implement get_facet_fml() via tinyformula()/tinyframe()

Open
#612 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
427
Forks
25
Avg merge
22h 54m
Merged PRs (30d)
28

Description

The tinyplot.formula() method uses auxiliary functions tinyformula()/tinyframe() (see https://github.com/grantmcdermott/tinyplot/blob/main/R/tinyformula.R) for processing its formulas, including facets.

In sanitize_facet() (see https://github.com/grantmcdermott/tinyplot/blob/main/R/sanitize_facet.R) an auxiliary function get_facet_fml() (see https://github.com/grantmcdermott/tinyplot/blob/main/R/facet.R#L680-L726) is used for cases when facet is still a formula. However, get_facet_fml() is not implemented using tinyformula()/tinyframe(). It might be a good idea to harmonize/streamline this implementation. This first came up in #562

As a first step, I tried to come up with an example when get_facet_fml() is actually used successfully. Could you provide an example, Grant @grantmcdermott ?

My reading is that this can only happen if tinyplot.default() is used because tinyplot.formula() already parses facet formulas and does not pass these on. But in tinyplot.default() I always get an error if I do tinyplot(x, y, facet = a ~ b) or tinyplot(x, y, facet = a ~ b, data = d).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Compare get_facet_fml() in R/facet.R with tinyformula()/tinyframe() in R/tinyformula.R and its use from R/sanitize_facet.R. Reproduce the facet formula cases through tinyplot.default(), with and without data, to establish a working example. Done means the example works and get_facet_fml() is harmonized with the existing formula-processing helpers.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data-visualization
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.