result <- t.test(CO2$conc, mu=550)
In a couple of other posts, I discussed strategies for inline reporting of epoxy
which is used for “extra-strength inline syntax.” Let’s give it a go…
Here we perform a one sample t-test and assign it to a variable. Here is automatically gets added to a list which can be accessed with the
From this we get a
result$p.value
[1] 0.0006133941
Unfortunately, the result isn’t formatted very nicely.
In the past, following the Schloss method, I would have used the scales::pvalue()
verb to format the value.
This would be written as: `r scales::pvalue(result$p.value)`
to produce epoxy
library makes this easier.
An epoxy
chunk written like this…
```{epoxy}
$p$ = {result$p.value}
```
will produce this…
But reformatting with epoxy
, which relies on the same scales()
package under the hood, does it very simply.
```{epoxy}
$p$ = {.pvalue result$p.value}
```
will produce this…
Documentation has options for various inline transformers. For example, we might want to do something with money. For example we might write:
```{epoxy}
I want to find {.dollar 123456789} dollars.
```
this will produce…
I want find $123,456,789 dollars.
Citation
@online{craig2024,
author = {Craig, Nathan},
title = {Inline {Reporting} {Redux}},
date = {2024-03-12},
url = {https://ncraig.netlify.app/posts/2024-03-12-inline-reporting-redux/index.html},
langid = {en}
}