Template based on Rmarkdown, using the united HTML theme.
Refer to a sub section. Citing an article (Adams 1993). Refer to section Analysis.
Loading libraries:
library(DT)
library(ggplot2)
library(xfun)
Vestibulum
imperdiet1, ex vel sodales facilisis, nibh tellus imperdiet massa, sit amet scelerisque orci velit vel tellus. Ut consequat justo tincidunt porttitor varius. Suspendisse erat ipsum, feugiat vitae rhoncus non, molestie ac purus. Morbi aliquet, elit eget blandit suscipit, est lacus facilisis turpis, nec fermentum nunc felis et lorem.
A nice table example:
DT::datatable(mtcars, options = list(pageLength = 3))
Suspendisse potenti
We can have math formulas inline like this: \(E=mc^2\) or make them span an entire line like this:
\[f=\frac{a}{b+c}\]
Create a horizontal line using markdown syntax:
Cras pulvinar ligula ac nisi porttitor, volutpat congue orci tincidunt. Pellentesque non mi congue, porta enim eget, venenatis sem. Integer suscipit vulputate tellus, eget commodo dolor gravida vel. Suspendisse gravida gravida ligula, in interdum sapien molestie ut.
In ut vehicula risus. Refer to the table above!
options(scipen=999) # turn-off scientific notation like 1e+48
theme_set(theme_bw()) # pre-set the bw theme.
data("midwest", package = "ggplot2")
# midwest <- read.csv("http://goo.gl/G1K41K") # bkup data source
# Scatterplot
gg = ggplot(midwest, aes(x=area, y=poptotal)) +
geom_point(aes(col=state, size=popdensity)) +
geom_smooth(method="loess", se=F) +
xlim(c(0, 0.1)) +
ylim(c(0, 500000)) +
labs(subtitle="Area Vs Population",
y="Population",
x="Area",
title="Scatterplot",
caption = "Source: midwest")
plot(gg)
## `geom_smooth()` using formula 'y ~ x'
Remember equation 1!
Wrapping it up!
Be careful, be gentle, be brave! And remember the above box!
A tip!
A note!
I have something important to say here!
An orange box!!!
xfun::session_info()
R version 3.6.3 (2020-02-29)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.5 LTS
Locale:
LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
LC_PAPER=en_US.UTF-8 LC_NAME=C
LC_ADDRESS=C LC_TELEPHONE=C
LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
Package version:
assertthat_0.2.1 backports_1.1.8 base64enc_0.1-3 BH_1.72.0.3
callr_3.4.3 cli_2.0.2 colorspace_1.4-1 compiler_3.6.3
crayon_1.3.4 crosstalk_1.1.0.1 desc_1.2.0 digest_0.6.25
dplyr_1.0.0 DT_0.14 ellipsis_0.3.1 evaluate_0.14
fansi_0.4.1 farver_2.0.3 generics_0.0.2 ggplot2_3.3.2
glue_1.4.1 graphics_3.6.3 grDevices_3.6.3 grid_3.6.3
gtable_0.3.0 highr_0.8 htmltools_0.5.0 htmlwidgets_1.5.1
isoband_0.2.2 jsonlite_1.7.0 knitr_1.29 labeling_0.3
later_1.1.0.1 lattice_0.20-41 lazyeval_0.2.2 lifecycle_0.2.0
magrittr_1.5 markdown_1.1 MASS_7.3.51.6 Matrix_1.2-18
methods_3.6.3 mgcv_1.8-31 mime_0.9 munsell_0.5.0
nlme_3.1-148 pillar_1.4.4 pkgbuild_1.0.8 pkgconfig_2.0.3
pkgload_1.1.0 praise_1.0.0 prettyunits_1.1.1 processx_3.4.2
promises_1.1.1 ps_1.3.3 purrr_0.3.4 R6_2.4.1
RColorBrewer_1.1.2 Rcpp_1.0.4.6 rlang_0.4.6 rmarkdown_2.3
rprojroot_1.3.2 rstudioapi_0.11 scales_1.1.1 splines_3.6.3
stats_3.6.3 stringi_1.4.6 stringr_1.4.0 testthat_2.3.2
tibble_3.0.1 tidyselect_1.1.0 tinytex_0.24 tools_3.6.3
utf8_1.1.4 utils_3.6.3 vctrs_0.3.1 viridisLite_0.3.0
withr_2.2.0 xfun_0.15 yaml_2.2.1
Adams, Peter. 1993. “The Title of the Work.” The Name of the Journal 4 (2): 201–13.