From fc3cb8f3b789e9eeff792a501ed98bc46b6028cf Mon Sep 17 00:00:00 2001 From: gadenbuie Date: Thu, 2 Nov 2023 14:07:56 +0000 Subject: [PATCH] Built site for epoxy: 0.1.0@9027028 --- v0.1.0/articles/epoxy-report.html | 2 +- v0.1.0/articles/epoxy-script.html | 2 +- v0.1.0/articles/epoxy-shiny.html | 2 +- v0.1.0/articles/epoxy.html | 2 +- v0.1.0/articles/index.html | 2 +- v0.1.0/articles/inline-reporting.html | 6 +++--- v0.1.0/news/index.html | 2 +- v0.1.0/pkgdown.yml | 2 +- v0.1.0/reference/bechdel.html | 2 +- v0.1.0/reference/engine_pick.html | 2 +- v0.1.0/reference/epoxy-package.html | 2 +- v0.1.0/reference/epoxy.html | 2 +- v0.1.0/reference/epoxy_style.html | 2 +- v0.1.0/reference/epoxy_transform.html | 2 +- v0.1.0/reference/epoxy_transform_html.html | 2 +- v0.1.0/reference/epoxy_transform_inline.html | 2 +- v0.1.0/reference/epoxy_transform_one_shot.html | 2 +- v0.1.0/reference/index.html | 2 +- v0.1.0/reference/render_epoxy.html | 2 +- v0.1.0/reference/run_epoxy_example_app.html | 2 +- v0.1.0/reference/ui_epoxy_html.html | 2 +- v0.1.0/reference/ui_epoxy_markdown.html | 2 +- v0.1.0/reference/ui_epoxy_mustache.html | 2 +- v0.1.0/reference/use_epoxy_knitr_engines.html | 2 +- v0.1.0/search.json | 2 +- 25 files changed, 27 insertions(+), 27 deletions(-) diff --git a/v0.1.0/articles/epoxy-report.html b/v0.1.0/articles/epoxy-report.html index cb897613..a315f57a 100644 --- a/v0.1.0/articles/epoxy-report.html +++ b/v0.1.0/articles/epoxy-report.html @@ -509,6 +509,6 @@

Raw LaTeX chunks + diff --git a/v0.1.0/articles/epoxy-script.html b/v0.1.0/articles/epoxy-script.html index 6b250ba3..c7254536 100644 --- a/v0.1.0/articles/epoxy-script.html +++ b/v0.1.0/articles/epoxy-script.html @@ -157,6 +157,6 @@ - + diff --git a/v0.1.0/articles/epoxy-shiny.html b/v0.1.0/articles/epoxy-shiny.html index 9722e0fa..7393a6f0 100644 --- a/v0.1.0/articles/epoxy-shiny.html +++ b/v0.1.0/articles/epoxy-shiny.html @@ -580,6 +580,6 @@

Mustache templates + diff --git a/v0.1.0/articles/epoxy.html b/v0.1.0/articles/epoxy.html index d41ca0c0..5bc69d28 100644 --- a/v0.1.0/articles/epoxy.html +++ b/v0.1.0/articles/epoxy.html @@ -181,6 +181,6 @@

Scripts

- + diff --git a/v0.1.0/articles/index.html b/v0.1.0/articles/index.html index 1a9cb0a3..9795096b 100644 --- a/v0.1.0/articles/index.html +++ b/v0.1.0/articles/index.html @@ -106,5 +106,5 @@

Articles

- + diff --git a/v0.1.0/articles/inline-reporting.html b/v0.1.0/articles/inline-reporting.html index 69926ab2..04af86bc 100644 --- a/v0.1.0/articles/inline-reporting.html +++ b/v0.1.0/articles/inline-reporting.html @@ -197,7 +197,7 @@

Collect your variables in listsRead more about [`knitr::knit()`]({knitted$doc_url}). ```
-

Report prepared on 2023-11-01 from inline-reporting.Rmd +

Report prepared on 2023-11-02 from inline-reporting.Rmd with knitr version 1.45 😆. Read more about knitr::knit().

This is still essentially equivalent to R Markdown’s inline R chunks. @@ -210,7 +210,7 @@

Collect your variables in listsRead more about [`knitr::knit()`]({doc_url}). ```
-

Report prepared on 2023-11-01 from inline-reporting.Rmd +

Report prepared on 2023-11-02 from inline-reporting.Rmd with knitr version 1.45 😆. Read more about knitr::knit().

Note that we can still have arbitrary R code in epoxy inline @@ -430,6 +430,6 @@

Template inline reporting chunks + diff --git a/v0.1.0/news/index.html b/v0.1.0/news/index.html index 3a2c07c7..e3d71341 100644 --- a/v0.1.0/news/index.html +++ b/v0.1.0/news/index.html @@ -141,5 +141,5 @@

epoxy 0.0.2 + diff --git a/v0.1.0/pkgdown.yml b/v0.1.0/pkgdown.yml index 3b82f9d9..f5c92bfd 100644 --- a/v0.1.0/pkgdown.yml +++ b/v0.1.0/pkgdown.yml @@ -7,7 +7,7 @@ articles: epoxy-shiny: epoxy-shiny.html epoxy: epoxy.html inline-reporting: inline-reporting.html -last_built: 2023-11-01T21:20Z +last_built: 2023-11-02T14:07Z urls: reference: http://pkg.garrickadenbuie.com/epoxy/v0.1.0/reference article: http://pkg.garrickadenbuie.com/epoxy/v0.1.0/articles diff --git a/v0.1.0/reference/bechdel.html b/v0.1.0/reference/bechdel.html index 56442676..7a0129dc 100644 --- a/v0.1.0/reference/bechdel.html +++ b/v0.1.0/reference/bechdel.html @@ -166,5 +166,5 @@

Source< - + diff --git a/v0.1.0/reference/engine_pick.html b/v0.1.0/reference/engine_pick.html index e97967da..4c67e79a 100644 --- a/v0.1.0/reference/engine_pick.html +++ b/v0.1.0/reference/engine_pick.html @@ -129,5 +129,5 @@

Examples + diff --git a/v0.1.0/reference/epoxy-package.html b/v0.1.0/reference/epoxy-package.html index 8438d92a..98f2339c 100644 --- a/v0.1.0/reference/epoxy-package.html +++ b/v0.1.0/reference/epoxy-package.html @@ -110,5 +110,5 @@

Author< - + diff --git a/v0.1.0/reference/epoxy.html b/v0.1.0/reference/epoxy.html index 261ab6d4..da0cb928 100644 --- a/v0.1.0/reference/epoxy.html +++ b/v0.1.0/reference/epoxy.html @@ -336,5 +336,5 @@

Examples + diff --git a/v0.1.0/reference/epoxy_style.html b/v0.1.0/reference/epoxy_style.html index 476f9698..abe246d7 100644 --- a/v0.1.0/reference/epoxy_style.html +++ b/v0.1.0/reference/epoxy_style.html @@ -145,5 +145,5 @@

Functions + diff --git a/v0.1.0/reference/epoxy_transform.html b/v0.1.0/reference/epoxy_transform.html index 84de7edc..1dcf3f67 100644 --- a/v0.1.0/reference/epoxy_transform.html +++ b/v0.1.0/reference/epoxy_transform.html @@ -277,5 +277,5 @@

Examples + diff --git a/v0.1.0/reference/epoxy_transform_html.html b/v0.1.0/reference/epoxy_transform_html.html index 1f4db5b4..c77a9286 100644 --- a/v0.1.0/reference/epoxy_transform_html.html +++ b/v0.1.0/reference/epoxy_transform_html.html @@ -259,5 +259,5 @@

Examples + diff --git a/v0.1.0/reference/epoxy_transform_inline.html b/v0.1.0/reference/epoxy_transform_inline.html index da3c12a7..b488e6b6 100644 --- a/v0.1.0/reference/epoxy_transform_inline.html +++ b/v0.1.0/reference/epoxy_transform_inline.html @@ -433,5 +433,5 @@

Examples + diff --git a/v0.1.0/reference/epoxy_transform_one_shot.html b/v0.1.0/reference/epoxy_transform_one_shot.html index 929bf971..ef24a115 100644 --- a/v0.1.0/reference/epoxy_transform_one_shot.html +++ b/v0.1.0/reference/epoxy_transform_one_shot.html @@ -240,5 +240,5 @@

Examples + diff --git a/v0.1.0/reference/index.html b/v0.1.0/reference/index.html index 09cf5e29..79b51315 100644 --- a/v0.1.0/reference/index.html +++ b/v0.1.0/reference/index.html @@ -196,5 +196,5 @@

Example Datasets + diff --git a/v0.1.0/reference/render_epoxy.html b/v0.1.0/reference/render_epoxy.html index 11d2ccb5..3fd0e4af 100644 --- a/v0.1.0/reference/render_epoxy.html +++ b/v0.1.0/reference/render_epoxy.html @@ -195,5 +195,5 @@

Examples + diff --git a/v0.1.0/reference/run_epoxy_example_app.html b/v0.1.0/reference/run_epoxy_example_app.html index ecd3f3c5..3985c4f8 100644 --- a/v0.1.0/reference/run_epoxy_example_app.html +++ b/v0.1.0/reference/run_epoxy_example_app.html @@ -191,5 +191,5 @@

Examples + diff --git a/v0.1.0/reference/ui_epoxy_html.html b/v0.1.0/reference/ui_epoxy_html.html index c84993c1..b92015bb 100644 --- a/v0.1.0/reference/ui_epoxy_html.html +++ b/v0.1.0/reference/ui_epoxy_html.html @@ -331,5 +331,5 @@

Examples + diff --git a/v0.1.0/reference/ui_epoxy_markdown.html b/v0.1.0/reference/ui_epoxy_markdown.html index 8bfb6b5a..377a3615 100644 --- a/v0.1.0/reference/ui_epoxy_markdown.html +++ b/v0.1.0/reference/ui_epoxy_markdown.html @@ -327,5 +327,5 @@

Examples + diff --git a/v0.1.0/reference/ui_epoxy_mustache.html b/v0.1.0/reference/ui_epoxy_mustache.html index 82c81f2c..2369ef25 100644 --- a/v0.1.0/reference/ui_epoxy_mustache.html +++ b/v0.1.0/reference/ui_epoxy_mustache.html @@ -221,5 +221,5 @@

Examples + diff --git a/v0.1.0/reference/use_epoxy_knitr_engines.html b/v0.1.0/reference/use_epoxy_knitr_engines.html index 159dd962..5e1f2a80 100644 --- a/v0.1.0/reference/use_epoxy_knitr_engines.html +++ b/v0.1.0/reference/use_epoxy_knitr_engines.html @@ -178,5 +178,5 @@

Examples + diff --git a/v0.1.0/search.json b/v0.1.0/search.json index 1e12ada9..ef47fcf2 100644 --- a/v0.1.0/search.json +++ b/v0.1.0/search.json @@ -1 +1 @@ -[{"path":[]},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, caste, color, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement garrick@adenbuie.com. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.1, available https://www.contributor-covenant.org/version/2/1/code_of_conduct.html. Community Impact Guidelines inspired [Mozilla’s code conduct enforcement ladder][https://github.com/mozilla/inclusion]. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https://www.contributor-covenant.org/translations.","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2023 Garrick Aden-Buie Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/articles/epoxy-report.html","id":"setup","dir":"Articles","previous_headings":"","what":"Setup","title":"epoxy in Reports","text":"Loading epoxy adds four new knitr engines, chunk types. type lets intermix text R code data (expr table ), geared toward different output context. ⚠️ Caution: Previously, epoxy provided glue engine, conflicts similar chunk engine glue package. can update existing documents use epoxy engine, can explicitly use epoxy’s glue chunk including following setup chunk.","code":"library(epoxy) use_epoxy_glue_engine()"},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/articles/epoxy-report.html","id":"using-epoxy-chunks","dir":"Articles","previous_headings":"","what":"Using epoxy chunks","title":"epoxy in Reports","text":"use epoxy R Markdown document, create new chunk using engine choice. chunk, write markdown, HTML, LaTeX needed, wrapping R expressions inside delimiters epoxy chunk. average speed cars 15.4 mph. average distance traveled 42.98 ft. epoxy built around glue::glue(), evaluates R expressions { } inserts results string. chunk equivalent call glue::glue(): One immediate advantage using epoxy instead glue::glue() RStudio’s autocompletion feature works inside epoxy chunks! Typing cars$ chunk suggest columns cars.","code":"```{epoxy} The average speed of the cars was **{mean(cars$speed)} mph.** But on average the distance traveled was only _{mean(cars$dist)}_. ``` glue::glue(\"The average speed of the cars was **{mean(cars$speed)} mph**. But on average the distance traveled was only _{mean(cars$dist)} ft_.\") #> The average speed of the cars was **15.4 mph**. #> But on average the distance traveled was only _42.98 ft_."},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/articles/epoxy-report.html","id":"inline-transformers","dir":"Articles","previous_headings":"","what":"Inline transformers","title":"epoxy in Reports","text":"epoxy provides inline transformations inspired cli’s inline markup. transformer enabled default epoxy(), epoxy_html() epoxy_latex() respective knitr chunk engines. ’s example using small list containing data movie (expand section see full code movie). can use inline transformer format replacement text build description data. movie Back Future Part II released 1989. earned $118,450,002 budget $40,000,000, features movie stars Michael J. Fox, Christopher Lloyd, Lea Thompson, Thomas F. Wilson. Read inline transformations ?epoxy_transform_inline.","code":"movie <- list( year = 1989, title = \"Back to the Future Part II\", budget = 4e+07, domgross = 118450002, imdb_rating = 7.8, actors = c( \"Michael J. Fox\", \"Christopher Lloyd\", \"Lea Thompson\", \"Thomas F. Wilson\" ), runtime = 108L ) ```{epoxy} The movie {.emph {.titlecase movie$title}} was released in {.strong movie$year}. It earned {.dollar movie$domgross} with a budget of {.dollar movie$budget}, and it features movie stars {.and movie$actors}. ```"},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/articles/epoxy-report.html","id":"transform-replaced-values","dir":"Articles","previous_headings":"Inline transformers","what":"Transform replaced values","title":"epoxy in Reports","text":"can use epoxy_transform_wrap() epoxy_transform chunk option wrap evaluated R expression formatting templating text. can use pre-set epoxy_transform_bold(), epoxy_transform_italic(), epoxy_transform_code() transformers epoxy_transform(). cars stopped 2 120 feet starting speed 4—120 mph.","code":"```{epoxy, .transformer = epoxy_transform(\"bold\")} All cars stopped between {min(cars$dist)} and {max(cars$dist)} feet from a starting speed of {min(cars$speed)}---{max(cars$speed)} ```"},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/articles/epoxy-report.html","id":"epoxy-chunks-are-vectorized","dir":"Articles","previous_headings":"Inline transformers","what":"epoxy chunks are vectorized","title":"epoxy in Reports","text":"Unlike inline R code, epoxy chunks vectorized. can something watch can advantage: “” apple “b” banana “c” coconut “d” donut can collapse fields automatically using epoxy_transform_collapse() transformer. can choose vectors collapsed adding *, & | end expression. * collapses commas, e.g. {letters[1:3]*}. & collapses commas adds \" \" last two items | collapses commas adds \" \" last two items. first three letters , b, c. capitalized, , B, C. ’re indexed 1, 2, 3. can change separator entries last entry using sep, last _and _or specific arguments epoxy_transform_collapse() function.","code":"```{epoxy} {1:4}. \"{letters[1:4]}\" is for {c(\"apple\", \"banana\", \"coconut\", \"donut\")} ``` ```{epoxy, .transformer = epoxy_transform(\"collapse\")} - The first three letters are {letters[1:3]*}. - When capitalized, they are {LETTERS[1:3]&}. - They're indexed by {1:3|}. ```"},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/articles/epoxy-report.html","id":"templating-with-epoxy-chunks","dir":"Articles","previous_headings":"Inline transformers","what":"Templating with epoxy chunks","title":"epoxy in Reports","text":"’s also possible create reusable template. Use ref.label chunk option reuse template using values data chunk option, can list data frame. Chevrolet Malibu gets 19 city 27 highway miles per gallon. Dodge Caravan gets 7 city 24 highway miles per gallon. Ford Expedition gets 11 city 17 highway miles per gallon.","code":"mpg <- data.frame( manufacturer = c(\"Chevrolet\", \"Dodge\", \"Ford\"), model = c(\"Malibu\", \"Caravan\", \"Expedition\"), cty = c(19, 7, 11), hwy = c(27, 24, 17) ) ```{epoxy car-name, eval=FALSE} - A {manufacturer} {model} gets {cty} city and {hwy} highway miles per gallon. ``` ```{epoxy ref.label=\"car-name\", data = mpg} ```"},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/articles/epoxy-report.html","id":"whisker-engine","dir":"Articles","previous_headings":"","what":"Whisker engine","title":"epoxy in Reports","text":"Sometimes epoxy engine doesn’t quite deliver template power need. cases, can use whisker engine instead. Hello R User: just won $1000! Well, $600, taxes.","code":"```{r} contestant <- list(name = \"R User\", value = 1000, taxed = 600, in_ca = TRUE) ``` ```{whisker data = contestant, echo=FALSE} Hello {{name}}: You have just won ${{value}}! {{#in_ca}} Well, ${{taxed}}, after taxes. {{/in_ca}} ``` contestant <- list(name = \"R User\", value = 1000, taxed = 600, in_ca = TRUE)"},{"path":[]},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/articles/epoxy-report.html","id":"markdown-chunks","dir":"Articles","previous_headings":"HTML and LaTeX chunks","what":"Markdown chunks","title":"epoxy in Reports","text":"epoxy chunk engine can used output format. practice, works best markdown (.e. generally R Markdown Quarto) renders : ’re writing HTML LaTeX output, however, may need write literal HTML LaTeX document. epoxy chun, ’d need escape { } text doubling , otherwise content within treated template expression. avoid friction, epoxy provides two additional chunk engines, epoxy_html writing raw HTML epoxy_latex writing raw LaTeX.","code":"```{epoxy, data = mpg} - **{manufacturer}** _{model}_ ``` - **Chevrolet** _Malibu_ - **Dodge** _Caravan_ - **Ford** _Expedition_"},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/articles/epoxy-report.html","id":"raw-html-chunks","dir":"Articles","previous_headings":"HTML and LaTeX chunks","what":"Raw HTML chunks","title":"epoxy in Reports","text":"Use epoxy_html block epoxy (glue) R HTML together. output raw HTML. default, expressions types blocks wrapped {{ }}, like whisker templates . Notice output HTML wrapped pandoc raw html block, tells pandoc content HTML shouldn’t modified1. also means output chunk included HTML documents. epoxy_html block contained within another raw html block, want force output appear, can set chunk option html_raw = FALSE. epoxy_html uses two custom transformers, epoxy_transform_inline() epoxy_transform_html(), applying html transformer inline transformer. epoxy_transform_html() can use element.class#id syntax wrap expressions HTML elements (parts optional). Let’s use syntax place manufacturer model elements, custom class. epoxy_transform_html() applied first, {{.uppercase manufacturer}} assumed CSS class inline transformer class. can get access inline formatter adding one additional layer {{ }}. works even don’t use HTML formatter. last example, {{ {{.uppercase manufacturer }} }} produce CHEVROLET.","code":"
    ```{epoxy_html, data = mpg}
  • {{manufacturer}}<\/strong> {{model}}<\/em><\/li> ``` <\/ul>
      ```{=html}
    • Chevrolet<\/strong> Malibu<\/em><\/li>
    • Dodge<\/strong> Caravan<\/em><\/li>
    • Ford<\/strong> Expedition<\/em><\/li> ``` <\/ul> ````{=html}
        ```{epoxy_html, data = mpg, html_raw = FALSE}
      • {{manufacturer}}<\/strong> {{model}}<\/em><\/li> ``` <\/ul> ````
          ```{epoxy_html, data = mpg}
        • {{strong.car-make manufacturer}} {{em.car-model model}} <\/li> ``` <\/ul>
            ```{=html}
          • Chevrolet<\/strong> Malibu<\/em> <\/li>
          • Dodge<\/strong> Caravan<\/em> <\/li>
          • Ford<\/strong> Expedition<\/em> <\/li> ``` <\/ul> ```{epoxy_html data = mpg[1,]} {{.uppercase manufacturer}} ``` ```{=html} Chevrolet<\/span> ``` ```{epoxy_html data = mpg[1,]} {{span {{.uppercase manufacturer}} }} ``` ```{=html} CHEVROLET<\/span> ```"},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/articles/epoxy-report.html","id":"raw-latex-chunks","dir":"Articles","previous_headings":"HTML and LaTeX chunks","what":"Raw LaTeX chunks","title":"epoxy in Reports","text":"Similarly, can also use epoxy_latex chunks epoxy R LaTeX together. default, expressions types chunks wrapped < >. R Markdown knitting LaTeX output, renders : Note , like epoxy_html chunks, epoxy_latex places output raw latex blocks. behavior can disabled setting chunk option latex_raw = FALSE.","code":"\\begin{itemize} ```{epoxy_latex, data = mpg} \\item \\textbf{} \\textit{} gets city and highway miles per gallon. ``` \\end{itemize} \\begin{itemize} ```{=latex} \\item \\textbf{Chevrolet} \\textit{Malibu} gets 19 city and 27 highway miles per gallon. \\item \\textbf{Dodge} \\textit{Caravan} gets 7 city and 24 highway miles per gallon. \\item \\textbf{Ford} \\textit{Expedition} gets 11 city and 17 highway miles per gallon. ``` \\end{itemize}"},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/articles/epoxy-shiny.html","id":"templating-in-shiny","dir":"Articles","previous_headings":"","what":"Templating in Shiny","title":"epoxy in Shiny","text":"Shiny apps great way design interactive web applications, epoxy includes several functions help weave reactive data apps. ways can use epoxy Shiny apps: Make text portion element Shiny UI update dynamically. Weave reactive text prose app. Build powerful templates using mustache templating language. Shiny already includes two reactive text outputs: shiny::uiOutput() (.k.. shiny::htmlOutput()) shiny::textOutput(). great displaying reactive text app, limitations: uiOutput() tends move UI code server function, making harder know final structure UI. textOutput() great displaying reactive text, takes work get spacing around dynamic text just right. article, ’ll learn use epoxy Shiny apps epoxy improves experience writing apps dynamic text templates.","code":""},{"path":[]},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/articles/epoxy-shiny.html","id":"a-basic-shiny-app-with-textoutput","dir":"Articles","previous_headings":"Introducing epoxy in Shiny","what":"A basic Shiny app with textOutput()","title":"epoxy in Shiny","text":"Let’s start example Shiny app. ’s simple friendly app greets user name. gets pretty close want, remember include inline = TRUE textOutput(). ’s also extra space user’s name exclamation point ’d probably like get rid of1.","code":"library(shiny) ui <- fluidPage( textInput(\"name\", \"What's your name?\"), p(\"Hello,\", textOutput(\"greeting\", inline = TRUE), \"!\") ) server <- function(input, output) { output$greeting <- renderText(input$name) } shinyApp(ui, server)"},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/articles/epoxy-shiny.html","id":"setting-up-ui_epoxy_html","dir":"Articles","previous_headings":"Introducing epoxy in Shiny","what":"Setting up ui_epoxy_html()","title":"epoxy in Shiny","text":"’s approach dynamic text ui_epoxy_html(): Wrap portion UI ui_epoxy_html() give .id. Use {{ name }} syntax define fields dynamic text go. server code, assign render_epoxy() output matching UI’s .id pass reactive data arguments names matching dynamic fields.","code":"library(shiny) library(epoxy) ui <- fluidPage( textInput(\"name\", \"What's your name?\"), ui_epoxy_html( #<< Template wrapper .id = \"greeting\", #<< Unique ID p(\"Hello, {{name}}!\") #<< Dynamic text ) #<< ) server <- function(input, output) { output$greeting <- render_epoxy( #<< Connect to template name = input$name #<< Reactive data field ) } shinyApp(ui, server)"},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/articles/epoxy-shiny.html","id":"default-or-error-values","dir":"Articles","previous_headings":"Introducing epoxy in Shiny","what":"Default or error values","title":"epoxy in Shiny","text":"Another advantage using ui_epoxy_html() textOutput() can set default values appear immediately app loading used error occurs. next app, name set \"friend\" default ui_epoxy_html(), server side ’ve also added validate() call indicating need name least 2 characters. user hasn’t yet entered name 2 characters, text name field use default value red squiggle . Hovering squiggle reveals error message.","code":"library(shiny) library(epoxy) ui <- fluidPage( textInput(\"name\", \"What's your name?\"), ui_epoxy_html( .id = \"greeting\", p(\"Hello, {{name}}!\"), name = \"friend\" ) ) server <- function(input, output) { name <- reactive({ validate(need( nchar(input$name) > 2, \"Name must be more than 2 characters.\" )) input$name }) output$greeting <- render_epoxy( name = name() ) } shinyApp(ui, server)"},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/articles/epoxy-shiny.html","id":"few-more-things","dir":"Articles","previous_headings":"Introducing epoxy in Shiny","what":"A few more things about ui_epoxy_html()","title":"epoxy in Shiny","text":"First, can reference reactive value, e.g. {{ name }}, many times want template. value can also go just anywhere UI. long ’s okay put around text2. can use {{ }} syntax3 epoxy_html(), makes possible determine HTML element class used contain dynamic text4. send array values reactive field, tag used template, making easy things like dynamically update list. Three quick things ui_epoxy_html(): assumes bare character strings HTML, don’t worry adding HTML() place. replacement text assumed HTML, default, save accidentally injecting unsafe HTML user input app. ’re certain field contain safe HTML, can mark safe HTML three braces, e.g. {{{ }}}. replacement text sent bare text HTML, making like textOutput() uiOutput(). particular, uiOutput() allow send arbitary widgets based htmlwidgets htmltools, ui_epoxy_html() ever sends bare text HTML.","code":"library(shiny) library(epoxy) ui <- fluidPage( textInput(\"name\", \"What's your name?\"), ui_epoxy_html( .id = \"greeting\", selectInput( inputId = \"color\", label = \"What's your favorite color, {{ name }}?\", choices = c(\"red\", \"green\", \"blue\", \"purple\", \"yellow\") ), name = \"friend\" ) ) server <- function(input, output) { output$greeting <- render_epoxy( name = input$name ) } shinyApp(ui, server) library(shiny) library(epoxy) ui <- fluidPage( textInput(\"faves\", \"What are your favorite fruits?\"), helpText(\"Enter a list of comma-separated fruits.\"), ui_epoxy_html( .id = \"fruit_list\", tags$ul(\"{{ li fruits }}\"), fruits = \"favorite fruits\" ) ) server <- function(input, output) { fruits <- reactive({ validate(need( nzchar(input$faves), \"Please share your favorite fruits.\" )) fruits <- trimws(strsplit(input$faves, \",\\\\s*\")[[1]]) fruits[nzchar(fruits)] }) output$fruit_list <- render_epoxy( fruits = fruits() ) } shinyApp(ui, server)"},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/articles/epoxy-shiny.html","id":"connecting-epoxy-with-a-reactive-data-frame","dir":"Articles","previous_headings":"","what":"Connecting epoxy with a reactive data frame","title":"epoxy in Shiny","text":"One favorite use cases epoxy’s Shiny functions create UI template ’s filled row data frame. pattern, app’s inputs combined reactive expression filters data frame single row. , row sent via render_epoxy() UI, ’s dynamically injected template UI. ’s small example using epoxy’s built bechdel data set, small data set 10 highest-rated movies pass Bechdel test. app, user picks movie template filled information data set movie. Notice instead passing named arguments field render_epoxy(), pass entire data frame .list argument. can use pattern list reactiveVal(), reactive() returns data frame, list list-like object, reactiveValues() list. .list can coexist named expressions. want build entire list within single reactive expression, set .list equal expression, wrapped braces:","code":"library(shiny) library(epoxy) movie_choices <- bechdel$imdb_id names(movie_choices) <- bechdel$title ui <- fixedPage( selectInput(\"movie\", \"Pick a movie\", choices = movie_choices), ui_epoxy_html( .id = \"movie_info\", p( \"{{ em title }} was released\", \"in {{ strong year }}.\", \"It was directed by {{ director }}\", \"and was rated {{ rated }}.\" ) ) ) server <- function(input, output, session) { movie <- reactive({ # Use the inputs to filter a single row bechdel[bechdel$imdb_id == input$movie, ] }) # Pass the reactive data frame to # the .list argument of render_epoxy() output$movie_info <- render_epoxy(.list = movie()) } shinyApp(ui, server) render_epoxy(.list = movie()) render_epoxy( name = input$name, .list = movie() ) render_epoxy(.list = { list( name = input$name, age = input$age ) })"},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/articles/epoxy-shiny.html","id":"markdown-templates","dir":"Articles","previous_headings":"","what":"Markdown templates","title":"epoxy in Shiny","text":"’re using epoxy write data-driven prose, might want use markdown templates, rather writing HTML. ui_epoxy_markdown() version ui_epoxy_html() uses markdown syntax instead HTML syntax5. Let’s revisit movie app last example, time using markdown template. even involved example, try epoxy markdown example app","code":"library(shiny) library(epoxy) movie_choices <- bechdel$imdb_id names(movie_choices) <- bechdel$title ui <- fixedPage( selectInput(\"movie\", \"Pick a movie\", choices = movie_choices), ui_epoxy_markdown( .id = \"movie_info\", \"_{{ title }}_ was released\", \"in **{{ year }}**.\", \"It was directed by {{ director }}\", \"and was rated {{ rated }}.\" ) ) server <- function(input, output, session) { movie <- reactive({ bechdel[bechdel$imdb_id == input$movie, ] }) output$movie_info <- render_epoxy(.list = movie()) } shinyApp(ui, server) run_epoxy_example_app(\"ui_epoxy_markdown\")"},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/articles/epoxy-shiny.html","id":"mustache-templates","dir":"Articles","previous_headings":"","what":"Mustache templates","title":"epoxy in Shiny","text":"complex templates, might want use template language like Mustache. R, know syntax whisker package. ui_epoxy_mustache()6 wraps Mustache language, letting blend typical shiny htmltools UI mustache template. use ui_epoxy_mustache() instead ui_epoxy_html()? template variables used HTML attributes, e.g. links images (via href src attributes). want use mustache’s conditional logic, e.g. {{#}} ... {{/}}. Let’s revist favorite fruits example app earlier. app use’s mustache’s conditional logic show help message fruits entered. uses mustache’s looping syntax show list fruits fruits entered. can find detailed example epoxy mustache example app. One important thing note ui_epoxy_mustache() , unlike ui_epoxy_html(), entire template re-rendered (browser) whenever reactive source updates. ’d better use smaller, localized templates wrap entire app ui_epoxy_mustache().","code":"library(shiny) library(epoxy) ui <- fluidPage( textInput(\"faves\", \"What are your favorite fruits?\"), ui_epoxy_mustache( id = \"fruit_list\", tags$ul( # If fruits is not empty, wrap into list items \"{{#fruits}}\", tags$li(\"{{.}}\"), \"{{/fruits}}\", # If fruits is empty, show a help message \"{{^fruits}}\", tags$li( class = \"text-muted\", \"Enter a list of comma-separated fruits.\" ), \"{{/fruits}}\" ) ) ) server <- function(input, output) { fruits <- reactive({ req(input$faves) fruits <- trimws(strsplit(input$faves, \",\\\\s*\")[[1]]) fruits[nzchar(fruits)] }) output$fruit_list <- render_epoxy( fruits = fruits() ) } shinyApp(ui, server) run_epoxy_example_app(\"ui_epoxy_mustache\")"},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/articles/epoxy.html","id":"use-epoxy","dir":"Articles","previous_headings":"","what":"Use epoxy","title":"epoxy","text":"Use epoxy blend data prose inline templating formatting. Use epoxy reactive templating targeted updates Shiny apps. Use epoxy R scripts, anywhere used glue.","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/articles/inline-reporting.html","id":"plug-in-reporting","dir":"Articles","previous_headings":"","what":"Plug-in reporting","title":"Inline Reporting","text":"Tristan Yihui Xie call inline reporting act interleaving R expressions prose markdown text. click Knit button call rmarkdown::render() build report, knitr evaluates R expressions, turns text plugs output. common use case reporting descriptive statistics. illustrate, ’ll use Orange dataset contains circumference measurements 5 orange trees 7 points time. R code might use summarize Orange data: lines might include report growth trees: dataset contains 35 tree size measurements 5 trees 7 timepoints study. normal R Markdown inline reporting written .Rmd file instead: two forms similar, epoxy chunk approach provides advantages, ’ll discover vignette.","code":"n_trees <- length(levels(Orange$Tree)) n_timepoints <- length(unique(Orange$age)) ```{r setup, include = FALSE} library(epoxy) ``` ```{epoxy} The dataset contains {nrow(Orange)} tree size measurements from {n_trees} trees at {n_timepoints} time points in the study. ``` The dataset contains `r nrow(Orange)` tree size measurements from `r n_trees` trees at `r n_timepoints` time points in the study."},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/articles/inline-reporting.html","id":"collect-your-variables-in-lists","dir":"Articles","previous_headings":"","what":"Collect your variables in lists","title":"Inline Reporting","text":"example, used normal variables available global environment document. small structural change can bring great benefits. ’s worth reading Tristan’s blog post, steal thunder: store data lists. , one hand, create variables named knitted_when, knitted_where knitted_with store facts knitting process. knitted_ prefix helpful aid remember variables related. store three variables single object instead. Bundling everything list() allows report results accessing list elements name $. Report prepared 2023-11-01 inline-reporting.Rmd knitr version 1.45 😆. Read knitr::knit(). still essentially equivalent R Markdown’s inline R chunks. epoxy chunks include data chunk argument, allows us reference items knitted list directly without use $. Report prepared 2023-11-01 inline-reporting.Rmd knitr version 1.45 😆. Read knitr::knit(). Note can still arbitrary R code epoxy inline expressions: emo_ji() function — vignette-safe version emo::ji() — exists global environment.","code":"knitted <- list( when = format(Sys.Date()), where = knitr::current_input(), with = format(utils::packageVersion(\"knitr\")), doc_url = \"https://rdrr.io/pkg/knitr/man/knit.html\" ) ```{epoxy} Report prepared on {knitted$when} from `{knitted$where}` with knitr version {knitted$with} {emo_ji('happy')}. Read more about [`knitr::knit()`]({knitted$doc_url}). ``` ```{epoxy knitted-2, data = knitted} Report prepared on {when} from `{where}` with knitr version {with} {emo_ji('happy')}. Read more about [`knitr::knit()`]({doc_url}). ```"},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/articles/inline-reporting.html","id":"reporting-model-results","dir":"Articles","previous_headings":"","what":"Reporting Model Results","title":"Inline Reporting","text":"Suppose model results ’ve prepared table (details, see Tristan’s blog post). results summarize linear mixed model estimating population averages trees grown several ozone conditions. ’ve copied resulting data frame vignette avoid taking extra dependencies vignette. can use split() make list data frames can index values term column. now list one-row dataframes: Now can write results inline reporting: average log-size control condition 4.25 units, 95% Wald CI [4.00, 4.51]. statistically clear difference ozone conditions intercepts (day-0 values), B = −0.14, [−0.45, 0.17]. control group, average growth rate 0.34 log-size units per 100 days, [0.31, 0.36]. growth rate ozone treatment group significantly slower, diff = −0.04, [−0.07, −0.01].","code":"text_ready <- data.frame( term = c(\"intercept\", \"hund_days\", \"ozone\", \"hund_days_ozone\"), estimate = c(\"4.25\", \"0.34\", \"−0.14\", \"−0.04\"), se = c(0.131, 0.013, 0.158, 0.015), ci = c(\"[4.00, 4.51]\", \"[0.31, 0.36]\", \"[−0.45, 0.17]\",\"[−0.07, −0.01]\"), stringsAsFactors = FALSE ) stats <- split(text_ready, text_ready$term) str(stats) #> List of 4 #> $ hund_days :'data.frame': 1 obs. of 4 variables: #> ..$ term : chr \"hund_days\" #> ..$ estimate: chr \"0.34\" #> ..$ se : num 0.013 #> ..$ ci : chr \"[0.31, 0.36]\" #> $ hund_days_ozone:'data.frame': 1 obs. of 4 variables: #> ..$ term : chr \"hund_days_ozone\" #> ..$ estimate: chr \"−0.04\" #> ..$ se : num 0.015 #> ..$ ci : chr \"[−0.07, −0.01]\" #> $ intercept :'data.frame': 1 obs. of 4 variables: #> ..$ term : chr \"intercept\" #> ..$ estimate: chr \"4.25\" #> ..$ se : num 0.131 #> ..$ ci : chr \"[4.00, 4.51]\" #> $ ozone :'data.frame': 1 obs. of 4 variables: #> ..$ term : chr \"ozone\" #> ..$ estimate: chr \"−0.14\" #> ..$ se : num 0.158 #> ..$ ci : chr \"[−0.45, 0.17]\" ```{epoxy} The average log-size in the control condition was {stats$intercept$estimate} units, 95% Wald CI {stats$intercept$ci}. There was not a statistically clear difference between the ozone conditions for their intercepts (day-0 values), *B* = {stats$ozone$estimate}, {stats$ozone$ci}. For the control group, the average growth rate was {stats$hund_days$estimate} log-size units per 100 days, {stats$hund_days$ci}. The growth rate for the ozone treatment group was significantly slower, *diff* = {stats$hund_days_ozone$estimate}, {stats$hund_days_ozone$ci}. ```"},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/articles/inline-reporting.html","id":"inline-reporting-with-autocomplete","dir":"Articles","previous_headings":"Reporting Model Results","what":"Inline reporting with autocomplete","title":"Inline Reporting","text":"’s extra neat epoxy — readily apparent ’re reading vignette — RStudio’s autocomplete feature kicks type stats$ inside braced expression { }. Actually, IDE doesn’t know epoxy knitr engine, autocomplete tries help every word. ’s typically easy ignore suggestions words part prose, ’s usually outweighed usefulness able autocomplete names data structures.","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/articles/inline-reporting.html","id":"intermittent-inline-reporting","dir":"Articles","previous_headings":"Reporting Model Results","what":"Intermittent inline-reporting","title":"Inline Reporting","text":"Note don’t need write entire document even paragraph inside epoxy chunk; can wrap data-heavy parts needed. statistically clear difference ozone conditions intercepts (day-0 values), B = −0.14, [−0.45, 0.17]. growth rate ozone treatment group significantly slower, diff = −0.04, [−0.07, −0.01].","code":"There was not a statistically clear difference between the ozone conditions for their intercepts (day-0 values), ```{epoxy} *B* = {stats$ozone$estimate}, {stats$ozone$ci}. ``` The growth rate for the ozone treatment group was significantly slower, ```{epoxy} *diff* = {stats$hund_days_ozone$estimate}, {stats$hund_days_ozone$ci}. ```"},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/articles/inline-reporting.html","id":"repeated-inline-reporting","dir":"Articles","previous_headings":"","what":"Repeated inline reporting","title":"Inline Reporting","text":"Occasionally may need re-use phrase document structure different slices data.","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/articles/inline-reporting.html","id":"vectorized-inline-reporting-chunks","dir":"Articles","previous_headings":"Repeated inline reporting","what":"Vectorized inline reporting chunks","title":"Inline Reporting","text":"Suppose summarize orange tree growth (normally use combination dplyr::group_by() dplyr::summarize() .) epoxy chunks, like glue::glue(), vectorized, find needing repeat thing , can use feature advantage. quick recap growth observed orange trees: Tree number 1 started 30mm , 1464 days, grew 145mm. Tree number 2 started 33mm , 1464 days, grew 203mm. Tree number 3 started 30mm , 1464 days, grew 140mm. Tree number 4 started 32mm , 1464 days, grew 214mm. Tree number 5 started 30mm , 1464 days, grew 177mm.","code":"summarize_tree_growth <- function(tree) { tree <- Orange[Orange$Tree == tree, ] tree <- data.frame( tree = tree$Tree[1], age_range = diff(range(tree$age)), circumference_first = tree$circumference[1], circumference_last = tree$circumference[nrow(tree)] ) tree$growth_rate <- with(tree, (circumference_last - circumference_first) / age_range) tree } orange_summary <- lapply(1:5, summarize_tree_growth) orange_summary <- do.call(rbind, orange_summary) orange_summary #> tree age_range circumference_first circumference_last growth_rate #> 1 1 1464 30 145 0.07855191 #> 2 2 1464 33 203 0.11612022 #> 3 3 1464 30 140 0.07513661 #> 4 4 1464 32 214 0.12431694 #> 5 5 1464 30 177 0.10040984 A quick recap of the growth observed in the orange trees: ```{epoxy data = orange_summary} - Tree number {tree} started out at {circumference_first}mm and, over {age_range} days, grew to be {circumference_last}mm. ```"},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/articles/inline-reporting.html","id":"template-inline-reporting-chunks","dir":"Articles","previous_headings":"Repeated inline reporting","what":"Template inline reporting chunks","title":"Inline Reporting","text":"using knitr’s reference labels feature, epoxy data chunk option saw , can create epoxy template can re-use like parameterized chunk. start creating labelled epoxy chunk eval = FALSE can later use prose referencing chunk ref.label providing different slice data via data chunk option. fourth tree largest tree end study, growing average 0.87mm per week. Meanwhile, smallest tree third, grew average 0.53mm per week.","code":"```{epoxy average-growth, eval=FALSE} an average of {signif(growth_rate * 7, 2)}mm per week. ``` The fourth tree was the largest tree at the end of the study, growing ```{epoxy ref.label=\"average-growth\", data = summarize_tree_growth(4)} ``` Meanwhile, the smallest tree was the third, which grew at ```{epoxy ref.label=\"average-growth\", data = summarize_tree_growth(3)} ```"},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Garrick Aden-Buie. Author, maintainer. Kushagra Gour. Contributor. hint.css mustache.js community. Contributor. mustache.js","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Aden-Buie G (2023). epoxy: String Interpolation Documents, Reports Apps. R package version 0.1.0, https://github.com/gadenbuie/epoxy, https://pkg.garrickadenbuie.com/epoxy/.","code":"@Manual{, title = {epoxy: String Interpolation for Documents, Reports and Apps}, author = {Garrick Aden-Buie}, year = {2023}, note = {R package version 0.1.0, https://github.com/gadenbuie/epoxy}, url = {https://pkg.garrickadenbuie.com/epoxy/}, }"},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/index.html","id":"epoxy-","dir":"","previous_headings":"","what":"String Interpolation for Documents, Reports and Apps","title":"String Interpolation for Documents, Reports and Apps","text":"Extra-strength glue scripts, reports, apps","code":""},{"path":[]},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/index.html","id":"in-r-markdown-and-quarto-reports","dir":"","previous_headings":"epoxy is super glue","what":"In R Markdown and Quarto reports","title":"String Interpolation for Documents, Reports and Apps","text":"Use epoxy chunks extra-strength inline syntax. Just library(epoxy) R Markdown Quarto document get started. epoxy chunks make easy transform values place cli-inspired inline syntax described ?epoxy_transform_inline.","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/index.html","id":"in-r-scripts","dir":"","previous_headings":"epoxy is super glue","what":"In R scripts","title":"String Interpolation for Documents, Reports and Apps","text":"functions power epoxy chunks availble three flavors: epoxy() markdown general purpose outputs epoxy_html() HTML outputs, added support HTML templating (see ?epoxy_transform_html) epoxy_latex() LaTeX reports functions accompanied robust system chained glue-transformers powered epoxy_transform().","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/index.html","id":"in-shiny-apps","dir":"","previous_headings":"epoxy is super glue","what":"In Shiny apps","title":"String Interpolation for Documents, Reports and Apps","text":"ui_epoxy_html() makes easy update text HTML dynamically, anywhere Shiny app’s UI. complicated situations, ui_epoxy_mustache() lets turn Shiny UI template leverages Mustache templating language.","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/index.html","id":"learn-more","dir":"","previous_headings":"","what":"Learn more","title":"String Interpolation for Documents, Reports and Apps","text":"’s whole lot epoxy can ! Get running epoxy reports Shiny apps. Get started Function reference usage examples. Reference Longer posts tutorials using epoxy reports apps. Articles","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"String Interpolation for Documents, Reports and Apps","text":"can install latest version epoxy remotes gadenbuie.r-universe.dev.","code":"# install.packages(\"remotes\") remotes::install_github(\"gadenbuie/epoxy\") options(repos = c( gadenbuie = \"https://gadenbuie.r-universe.dev/\", getOption(\"repos\") )) install.packages(\"epoxy\")"},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/reference/bechdel.html","id":null,"dir":"Reference","previous_headings":"","what":"Top 10 Highest-Rated, Bechdel-Passing Movies — bechdel","title":"Top 10 Highest-Rated, Bechdel-Passing Movies — bechdel","text":"small dataset epoxy demonstrations top audience-rated movies pass Bechdel Test.","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/reference/bechdel.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Top 10 Highest-Rated, Bechdel-Passing Movies — bechdel","text":"","code":"bechdel"},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/reference/bechdel.html","id":"format","dir":"Reference","previous_headings":"","what":"Format","title":"Top 10 Highest-Rated, Bechdel-Passing Movies — bechdel","text":"data frame 10 rows 18 variables: imdb_id IMDB Movie ID bechdel_rating Rating (0-3): 0 = unscored; 1 = least two (named) women ; 2 = talk ; 3 = something besides man. year Year title Title movie budget Budget $USD release year domgross Domestic gross $USD release year intgross International gross $USD release year plot Plot movie rated Moving rating, e.g. PG, PG-13, R, etc. language Language movie country Country movie produced imdb_rating IMDB rating movie, 0-10 director Director movie actors Major actors appearing movie genre Genre awards Awards won movie, text description runtime Movie runtime minutes poster URL movie poster image, sourced themoviedb.org. Poster images URLs ar provided TMDB API epoxy endorsed certified TMDB.","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/reference/bechdel.html","id":"source","dir":"Reference","previous_headings":"","what":"Source","title":"Top 10 Highest-Rated, Bechdel-Passing Movies — bechdel","text":"TidyTuesday (2021-03-09), FiveThirtyEight, bechdeltest.com, themoviedb.org","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/reference/engine_pick.html","id":null,"dir":"Reference","previous_headings":"","what":"Pick an engine-specific value — engine_pick","title":"Pick an engine-specific value — engine_pick","text":"Set different values used based current epoxy knitr engine (one md, html, latex). engine-specific value used inside epoxy knitr chunks epoxy functions matching source syntax: epoxy() (md), epoxy_html() (html), epoxy_latex() (latex).","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/reference/engine_pick.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Pick an engine-specific value — engine_pick","text":"","code":"engine_pick(md, html = md, latex = md)"},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/reference/engine_pick.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Pick an engine-specific value — engine_pick","text":"md, html, latex value use markdown, HTML, LaTeX context.","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/reference/engine_pick.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Pick an engine-specific value — engine_pick","text":"value md, html latex depending epoxy knitr currently evaluated.","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/reference/engine_pick.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Pick an engine-specific value — engine_pick","text":"","code":"# Markdown and HTML are okay with bare `$` character, # but we need to escape it in LaTeX. engine_pick(md = \"$\", latex = \"\\\\$\") #> [1] \"$\""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/reference/epoxy-package.html","id":null,"dir":"Reference","previous_headings":"","what":"epoxy: String Interpolation for Documents, Reports and Apps — epoxy-package","title":"epoxy: String Interpolation for Documents, Reports and Apps — epoxy-package","text":"Extra strength 'glue' data-driven templates. String interpolation 'Shiny' apps 'R Markdown' 'knitr'-powered 'Quarto' documents, built 'glue' 'whisker' packages.","code":""},{"path":[]},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/reference/epoxy-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"epoxy: String Interpolation for Documents, Reports and Apps — epoxy-package","text":"Maintainer: Garrick Aden-Buie garrick@adenbuie.com (ORCID) contributors: Kushagra Gour (hint.css) [contributor] mustache.js community (mustache.js) [contributor]","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/reference/epoxy.html","id":null,"dir":"Reference","previous_headings":"","what":"Epoxy string interpolation — epoxy","title":"Epoxy string interpolation — epoxy","text":"functions power knitr chunk engines wrappers around glue::glue(), extra conveniences provided epoxy. epoxy() super glue::glue(). epoxy_html() super glue::glue() HTML-specific defaults. epoxy_latex() super glue::glue() LaTeX-specific defaults. functions can called directly used knitr chunk engine chunk text handled string passed function version. used knitr chunk engine, function arguments can passed chunk options. epoxy(), epoxy_html() epoxy_latex() use epoxy_transform_inline() default. transformer brings concise inline-formatting syntax can read ?epoxy_transform_inline. epoxy_html() also includes inline transformation syntax makes easier wrap expression text HTML elements specific ID set classes. Learn syntax ?epoxy_transform_html.","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/reference/epoxy.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Epoxy string interpolation — epoxy","text":"","code":"epoxy( ..., .data = NULL, .sep = \"\", .envir = parent.frame(), .open = \"{\", .close = \"}\", .na = \"\", .null = \"\", .comment = character(), .literal = FALSE, .trim = FALSE, .transformer = NULL, .style = lifecycle::deprecated() ) epoxy_html( ..., .data = NULL, .sep = \"\", .envir = parent.frame(), .open = \"{{\", .close = \"}}\", .na = \"\", .null = \"\", .comment = \"\", .literal = FALSE, .trim = FALSE, .transformer = NULL ) epoxy_latex( ..., .data = NULL, .sep = \"\", .envir = parent.frame(), .open = \"<\", .close = \">\", .na = \"\", .null = \"\", .comment = \"\", .literal = FALSE, .trim = FALSE, .transformer = NULL )"},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/reference/epoxy.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Epoxy string interpolation — epoxy","text":"... [expressions] Unnamed arguments taken expression string(s) format. Multiple inputs concatenated together formatting. Named arguments taken temporary variables available substitution. .data data set .sep [character(1): ‘\"\"’] Separator used separate elements. .envir [environment: parent.frame()] Environment evaluate expression . Expressions evaluated left right. .x environment, expressions evaluated environment .envir ignored. NULL passed, equivalent emptyenv(). .open [character(1): ‘\\{’] opening delimiter around template variable expression. Doubling full delimiter escapes . .close [character(1): ‘\\}’] closing delimiter around template variable expression. Doubling full delimiter escapes . .na [character(1): ‘NA’] Value replace NA values . NULL missing values propagated, NA result cause NA output. Otherwise value replaced value .na. .null [character(1): ‘character()’] Value replace NULL values . character() whole output character(). NULL NULL values dropped (paste0()). Otherwise value replaced value .null. .comment [character(1): ‘#’] Value use comment character. .literal [boolean(1): ‘FALSE’] Whether treat single double quotes, backticks, comments regular characters (vs. syntactic elements), parsing expression string. Setting .literal = TRUE probably makes sense combination custom .transformer, case glue_col(). Regard argument (especially, name) experimental. .trim [logical(1): ‘TRUE’] Whether trim input template trim() . .transformer transformer function transformer chain created epoxy_transform(). Alternatively, character vector epoxy transformer names, e.g. c(\"bold\", \"collapse\") list epoxy transformers, e.g. list(epoxy_transform_bold(), epoxy_transform_collapse()). epoxy, likely want use defaults consult epoxy_transform() information. See also glue::glue() information transformers. .style Please use .transformer instead.","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/reference/epoxy.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Epoxy string interpolation — epoxy","text":"Returns transformed string, using glue::glue() additional transformers provided .transformer argument epoxy().","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/reference/epoxy.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Epoxy string interpolation — epoxy","text":"","code":"movie <- bechdel[1, ] movies <- bechdel[2:4, ] epoxy(\"*{movie$title}* ({movie$year}) was directed by {movie$director}.\") #> *Inception* (2010) was directed by Christopher Nolan. epoxy(\"- *{movies$title}* ({movies$year}) was directed by {movies$director}.\") #> - *Back to the Future Part II* (1989) was directed by Robert Zemeckis. #> - *The Simpsons Movie* (2007) was directed by David Silverman. #> - *Another Year* (2010) was directed by Mike Leigh. epoxy(\"*{title}* ({year}) was directed by {director}.\", .data = movie) #> *Inception* (2010) was directed by Christopher Nolan. epoxy(\"- *{title}* ({year}) was directed by {director}.\", .data = movies) #> - *Back to the Future Part II* (1989) was directed by Robert Zemeckis. #> - *The Simpsons Movie* (2007) was directed by David Silverman. #> - *Another Year* (2010) was directed by Mike Leigh. epoxy( \"{title} ({year}) was directed by {director}.\", .data = movie, .transformer = \"bold\" ) #> **Inception** (**2010**) was directed by **Christopher Nolan**. epoxy( \"I'd be happy to watch { title| }.\", .data = movies, .transformer = c(\"italic\", \"collapse\") ) #> I'd be happy to watch _Back to the Future Part II_, _The Simpsons Movie_, or _Another Year_. epoxy( \"They were directed by { director& }.\", .data = movies, .transformer = c(\"collapse\", \"bold\") ) #> They were directed by **Robert Zemeckis, David Silverman, and Mike Leigh**. epoxy(\"The budget for *{title}* was {.dollar budget}.\", .data = movie) #> The budget for *Inception* was $160,000,000. epoxy_html( \"I'd be happy to watch {{ title| }}.\", .data = movies, .transformer = c(\"italic\", \"collapse\") ) #> I'd be happy to watch Back to the Future Part II<\/em>, The Simpsons Movie<\/em>, or Another Year<\/em>. epoxy_latex( \"I'd be happy to watch < title| >.\", .data = movies, .transformer = c(\"italic\", \"collapse\") ) #> I'd be happy to watch \\emph{Back to the Future Part II}, \\emph{The Simpsons Movie}, or \\emph{Another Year}."},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/reference/epoxy_style.html","id":null,"dir":"Reference","previous_headings":"","what":"Deprecated: epoxy_style() — epoxy_style","title":"Deprecated: epoxy_style() — epoxy_style","text":"epoxy_style() renamed epoxy_transform() epoxy version 0.1.0.","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/reference/epoxy_style.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Deprecated: epoxy_style() — epoxy_style","text":"","code":"epoxy_style(...) epoxy_style_apply(...) epoxy_style_bold(...) epoxy_style_code(...) epoxy_style_collapse(...) epoxy_style_get(...) epoxy_style_html(...) epoxy_style_inline(...) epoxy_style_italic(...) epoxy_style_set(...) epoxy_style_wrap(...)"},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/reference/epoxy_style.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Deprecated: epoxy_style() — epoxy_style","text":"... Passed new epoxy_transform function.","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/reference/epoxy_style.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Deprecated: epoxy_style() — epoxy_style","text":"Returns result new epoxy_transform function.","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/reference/epoxy_style.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Deprecated: epoxy_style() — epoxy_style","text":"epoxy_style(): now epoxy_transform(). epoxy_style_apply(): now epoxy_transform_apply(). epoxy_style_bold(): now epoxy_transform_bold(). epoxy_style_code(): now epoxy_transform_code(). epoxy_style_collapse(): now epoxy_transform_collapse(). epoxy_style_get(): now epoxy_transform_get(). epoxy_style_html(): now epoxy_transform_html(). epoxy_style_inline(): now epoxy_transform_inline(). epoxy_style_italic(): now epoxy_transform_italic(). epoxy_style_set(): now epoxy_transform_set(). epoxy_style_wrap(): now epoxy_transform_wrap().","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/reference/epoxy_transform.html","id":null,"dir":"Reference","previous_headings":"","what":"epoxy Transformers — epoxy_transform","title":"epoxy Transformers — epoxy_transform","text":"transformers provide additional automatic formatting template strings. designed used .transformer chunk option epoxy chunks. can use epoxy_transform() chain several transformers together. epoxy_transform() individual epoxy transform functions can used epoxy, epoxy_html epoxy_latex chunks choose correct engine .","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/reference/epoxy_transform.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"epoxy Transformers — epoxy_transform","text":"","code":"epoxy_transform(..., engine = NULL, syntax = lifecycle::deprecated()) epoxy_transform_get(engine = c(\"md\", \"html\", \"latex\"), inline = FALSE) epoxy_transform_set(..., engine = NULL, syntax = lifecycle::deprecated())"},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/reference/epoxy_transform.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"epoxy Transformers — epoxy_transform","text":"... Transformer functions, e.g. epoxy_transform_bold name epoxy transform function, e.g. \"bold\", call transform function, e.g. epoxy_transform_bold(). epoxy_transform() chains transformer functions together, applying transformers order first last. example, epoxy_transform(\"bold\", \"collapse\") results replaced strings emboldened collapsed, e.g. **** **b**. hand, epoxy_transform(\"collapse\", \"bold\") collapse vector embolden entire string. epoxy_transform_apply(), ... passed underlying call underlying function call. epoxy_transform_collapse(), ... ignored. engine One \"markdown\" (\"md\"), \"html\", \"latex\". default chosen based engine chunk transform function called, according option epoxy.engine. Caution: invalid options silently ignored, falling back \"markdown\". syntax Use engine instead. inline epoxy_transform_get(), whether return session-specific inline formatting functions epoxy_transform_inline().","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/reference/epoxy_transform.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"epoxy Transformers — epoxy_transform","text":"function text envir suitable .transformer argument glue::glue().","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/reference/epoxy_transform.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"epoxy Transformers — epoxy_transform","text":"epoxy_transform(): Construct chained transformer using epoxy transformers use glue transformer. resulting transformers can passed .transformer argument epoxy() glue::glue(). epoxy_transform_get(): Get default epoxy .transformer epoxy engines subset engines. epoxy_transform_set(): Set default epoxy .transformer epoxy engines subset engines.","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/reference/epoxy_transform.html","id":"output-specific-transformations","dir":"Reference","previous_headings":"","what":"Output-specific transformations","title":"epoxy Transformers — epoxy_transform","text":"epoxy_transform_ functions attempt use correct engine transforming replacement text markdown, HTML LaTeX. choice driven chunk engine transformer function used. epoxy engine corresponds markdown, epoxy_html HTML, epoxy_latex LaTeX. Automatic engine selection works epoxy transform functions used epoxy knitr engines knitr rendering process. used outside context, can choose desired engine setting engine one \"markdown\", \"html\" \"latex\".","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/reference/epoxy_transform.html","id":"session-wide-settings","dir":"Reference","previous_headings":"","what":"Session-wide settings","title":"epoxy Transformers — epoxy_transform","text":"change transformer used epoxy() HTML LaTeX variants, use epoxy_transform_set(). function takes values epoxy_transform(), makes default transformer epoxy() calls specify transformer. default, setting made engines, can specify single engine engine argument. small example applies bold collapse transformers epoxy chunks: often, want update default transformer customize formatting functions used inline transformer. can use epoxy_transform_set() change settings existing formatting functions add new one. Pass new function argument dot-prefixed name. next example setting .dollar transformation use \"K\" \"M\" abbreviate large numbers. also adding transformation truncates long strings fit 8 characters. Note engine argument can used even inline tranformations, e.g. apply change HTML can use engine = \"html\". unset session defaults, two options: Unset everything passing NULL epoxy_transform_set(): Unset single inline transformation passing rlang::zap() named argument: can provide new values overwrite current settings. , can unset session defaults specific engine.","code":"epoxy_transform_set(\"bold\", \"collapse\") epoxy_transform_set( .dollar = scales::label_dollar( accuracy = 0.01, scale_cut = scales::cut_short_scale() ), .trunc8 = function(x) glue::glue_collapse(x, width = 8) ) epoxy(\"{.dollar 12345678}\") #> $12.34M epoxy(\"{.trunc8 12345678}\") #> 12345... epoxy_transform_set(NULL) epoxy_transform_set(.dollar = rlang::zap())"},{"path":[]},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/reference/epoxy_transform.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"epoxy Transformers — epoxy_transform","text":"","code":"epoxy(\"{.strong {.and letters[1:3]}}\") #> **a, b, and c** epoxy(\"{.and {.strong letters[1:3]}}\") #> **a**, **b**, and **c** # If you used the development version of epoxy, the above is equivalent to: epoxy(\"{letters[1:3]&}\", .transformer = epoxy_transform(\"bold\", \"collapse\")) #> **a**, **b**, and **c** epoxy(\"{letters[1:3]&}\", .transformer = epoxy_transform(\"collapse\", \"bold\")) #> **a, b, and c** # In an epoxy_html chunk... epoxy_html(\"{{.strong {{.or letters[1:3] }} }}\") #> a, b, or c<\/span> # Or in an epoxy_latex chunk... epoxy_latex(\"<.and <.strong letters[1:3] >>\") #> \\textbf{a}, \\textbf{b}, and \\textbf{c} # ---- Other Transformers ---- # Format numbers with an inline transformation amount <- 123.4234234 epoxy(\"{.number amount}\") #> 123 epoxy( \"{.number amount}\", .transformer = epoxy_transform_inline( .number = scales::label_number(accuracy = 0.01) ) ) #> 123.42 # Apply _any_ function to all replacements epoxy( \"{amount} is the same as {amount}\", .transformer = epoxy_transform_apply(round, digits = 0) ) #> 123 is the same as 123 epoxy( \"{amount} is the same as {amount}\", .transformer = epoxy_transform( epoxy_transform_apply(~ .x * 100), epoxy_transform_apply(round, digits = 2), epoxy_transform_apply(~ paste0(.x, \"%\")) ) ) #> 12342.34% is the same as 12342.34%"},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/reference/epoxy_transform_html.html","id":null,"dir":"Reference","previous_headings":"","what":"Concise syntax for expressions inside HTML elements — epoxy_transform_html","title":"Concise syntax for expressions inside HTML elements — epoxy_transform_html","text":"epoxy_transform_html() provides pug-like syntax expressions HTML wrapped HTML elements.","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/reference/epoxy_transform_html.html","id":"syntax","dir":"Reference","previous_headings":"","what":"Syntax","title":"Concise syntax for expressions inside HTML elements — epoxy_transform_html","text":"can specify HTML element id class text expression placed. template specify element using syntax , followed R expression, separated space: example, place expression
          • element id = \"food\" class = \"fruit\", write item HTML template optional: specific HTML element desired, element name must first. element specified, default set element argument epoxy_transform_html() used. IDs specified using # one ID may present Classes written using . many classes desired allowed. expression vector, element container used item vector. Finally, expression returns HTML, escaped default. can either use htmltools::HTML() mark safe HTML R, can write !!expr inline markup: {{ li#food.fruit !!fruit_name }}.","code":"{{ [][# | ....] expr }} {{ li#food.fruit fruit_name }}"},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/reference/epoxy_transform_html.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Concise syntax for expressions inside HTML elements — epoxy_transform_html","text":"","code":"epoxy_transform_html( class = NULL, element = \"span\", transformer = glue::identity_transformer )"},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/reference/epoxy_transform_html.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Concise syntax for expressions inside HTML elements — epoxy_transform_html","text":"class [character()] Additional classes added inline HTML element. element [character() default HTML element tag name used element specified expression. transformer transformer apply replacement string. argument used chaining transformer functions. providing function argument can apply additional transformation current transformation. nearly cases, can let epoxy_transform() handle . chain ends glue::identity_transformer() used transformer.","code":""},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/reference/epoxy_transform_html.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Concise syntax for expressions inside HTML elements — epoxy_transform_html","text":"function text envir suitable .transformer argument glue::glue().","code":""},{"path":[]},{"path":"http://pkg.garrickadenbuie.com/epoxy/v0.1.0/reference/epoxy_transform_html.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Concise syntax for expressions inside HTML elements — epoxy_transform_html","text":"","code":"epoxy_html(\"
              {{ li letters[1:3] }}<\/ul>\") #>
              • a<\/li><\/ul>
                • b<\/li><\/ul>
                  • c<\/li><\/ul> epoxy_html(\"
                      {{ li.alpha letters[1:3] }}<\/ul>\") #>
                      • a<\/li><\/ul>
                        • b<\/li><\/ul>
                          • c<\/li><\/ul> epoxy_html(\"
                              {{ li#my-letter letters[7] }}<\/ul>\") #>
                              • g<\/li><\/ul> # The default element is used if no element is directly requested epoxy_html(\"My name starts with {{ .name-letter letters[7] }}\") #> My name starts with g<\/span> epoxy_html( \"{{ h3#title title }}\", title = \"Epoxy for HTML\" ) #>

                                Epoxy for HTML<\/h3> # If your replacement text contains HTML, it's escaped by default. hello <- \"Hi there!<\/strong>\" epoxy_html(\"{{ hello }}\") #> <strong>Hi there!</strong> # You can use !! inline to mark the text as safe HTML... epoxy_html(\"{{ !!hello }}\") #> Hi there!<\/strong> epoxy_html(\"{{ button !!hello }}\") #>