Obinna N Obianom
2024-06-22
Obinna N Obianom
2024-06-22
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Pulvinar pellentesque habitant morbi tristique senectus et. Neque viverra justo nec ultrices. Non enim praesent elementum facilisis leo vel fringilla. Orci eu lobortis elementum nibh tellus molestie. Blandit turpis cursus in hac. Commodo sed egestas egestas fringilla phasellus faucibus.
library(scientific)
plot(1:100,sample(1:100))
boxplot(mtcars)
Aliquam malesuada bibendum arcu vitae elementum curabitur vitae. Donec enim diam vulputate ut pharetra sit amet aliquam. Semper viverra nam libero justo laoreet sit. Fermentum dui faucibus in ornare quam. Sed viverra tellus in hac habitasse platea dictumst vestibulum rhoncus. Ultricies mi eget mauris pharetra et. Ultrices mi tempus imperdiet nulla malesuada pellentesque elit eget. Imperdiet nulla malesuada pellentesque elit eget.
You can use the kable()
function from the knitr package to format tables that integrate well with the rest of the scientific handout style. The table captions are placed in the margin like figures in the HTML output.
knitr::kable(
mtcars[1:6, 1:6], caption = 'A subset of mtcars.'
)
mpg | cyl | disp | hp | drat | wt | |
---|---|---|---|---|---|---|
Mazda RX4 | 21.0 | 6 | 160 | 110 | 3.90 | 2.620 |
Mazda RX4 Wag | 21.0 | 6 | 160 | 110 | 3.90 | 2.875 |
Datsun 710 | 22.8 | 4 | 108 | 93 | 3.85 | 2.320 |
Hornet 4 Drive | 21.4 | 6 | 258 | 110 | 3.08 | 3.215 |
Hornet Sportabout | 18.7 | 8 | 360 | 175 | 3.15 | 3.440 |
Valiant | 18.1 | 6 | 225 | 105 | 2.76 | 3.460 |
We know from the Markdown syntax that paragraphs that start with >
are converted to block quotes. If you want to add a right-aligned footer for the quote, you may use the function quote_footer()
from scientific in an inline R expression. Here is an example:
“If it weren’t for my lawyer, I’d still be in prison. It went a lot faster with two people digging.”
Without using quote_footer()
, it looks like this (the second line is just a normal paragraph):
“Great people talk about ideas, average people talk about things, and small people talk about wine.”
— Fran Lebowitz
In fact, you can include anything in the margin using the knitr engine named marginfigure
. Unlike R code chunks ```{r}
, you write a chunk starting with ```{marginfigure}
instead, then put the content in the chunk. See an example on the right about the first fundamental theorem of calculus.
We know from the first fundamental theorem of calculus that for \(x\) in \([a, b]\): \[\frac{d}{dx}\left( \int_{a}^{x} f(u)\,du\right)=f(x).\]
OR
\[\frac{d}{dx}\left( \int_{b}^{x} f(x)\,du\right)=f(x).\]