
Summary
An archetype is a model to follow in drafting a post. A number of other synomyms also come to mind like form, template, outline, scaffold or layout. An archetype is a model kept within the archetypes folder in hugo. It’s a smart way to bring consistency to your posts. Below is the archetype I use in rending anR
analysis.
Table of Contents
R image
Figure 1: A plot with 538 layout theme and color blind palette.
Overview
(Describe the problem.)
Background
(Who else has worked on this problem? What did they find?)
Data and model
(What data did you use, where did you get it?)
Results
Conclusion
Acknowledgements
This blog post was made possible thanks to:
References
Appendix – Gist Embed
title | author | date | slug | categories | tags | layout | draft | bibliography | csl | link-citations | nocite | header | repo | summary | |||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
layouts/post/single |
false |
|
../ieee-with-url.csl |
true |
@R-base, @R-blogdown, @R-tidyverse
|
|
By default, Hugo automatically takes the first 70 words of your content as its summary and stores it into the `.Summary` page variable for use in your templates. You may customize the summary length by setting `summaryLength` in your site configuration *or* you can set it in the front matter. |
## Load frequently used packages for blog posts
packages <- c(
'devtools', #for session info
'ggthemes', #for plots
'blogdown'
)
lapply(packages, function(x) {
if (!requireNamespace(x)) install.packages(x)
library(x, character.only = TRUE)
})
## Do not break chunk line
## Do not use spaces or periods "." or underscores "_"
## set options for knitr
knitr::opts_chunk$set(
comment = '',
fig.width = 6,
fig.asp = .8,
fig.align="center",
message=F,
error=F,
warning=F,
tidy=T,
comment='',
cache=T,
dev='svg',
echo=F
)
#from ggthemes
library(ggplot2); theme_set(ggthemes::theme_fivethirtyeight())
# color blind friendly palette from http://www.cookbook-r.com/Graphs/Colors_(ggplot2)/
cbPalette <- c("#E69F00", "#56B4E9", "#009E73", "#F0E442", "#0072B2", "#D55E00", "#CC79A7", "#000000")
# write packages used to bib in current directory
knitr::write_bib(.packages(), "./packages.bib")
data(mtcars)
mtcars$cyl <- factor(mtcars$cyl)
p <- ggplot(mtcars, aes(mpg, hp, group = cyl, colour = cyl))
p <- p + scale_color_manual(values = cbPalette)
p <- p + geom_point(size = 2)
p <- p + ggtitle("mtcars")
p
(Describe the problem.)
(Who else has worked on this problem? What did they find?)
(What data did you use, where did you get it?)
This blog post was made possible thanks to:
The views, analysis and conclusions presented within this paper represent the author’s alone and not of any other person, organization or government entity. While I have made every reasonable effort to ensure that the information in this article was correct, it will nonetheless contain errors, inaccuracies and inconsistencies. It is a working paper subject to revision without notice as additional information becomes available. Any liability is disclaimed as to any party for any loss, damage, or disruption caused by errors or omissions, whether such errors or omissions result from negligence, accident, or any other cause. The author(s) received no financial support for the research, authorship, and/or publication of this article.
# system & package info
options(width = 120)
session_info()
Disclaimer
The views, analysis and conclusions presented within this paper represent the author’s alone and not of any other person, organization or government entity. While I have made every reasonable effort to ensure that the information in this article was correct, it will nonetheless contain errors, inaccuracies and inconsistencies. It is a working paper subject to revision without notice as additional information becomes available. Any liability is disclaimed as to any party for any loss, damage, or disruption caused by errors or omissions, whether such errors or omissions result from negligence, accident, or any other cause. The author(s) received no financial support for the research, authorship, and/or publication of this article. See overview.
Reproducibility
─ Session info ───────────────────────────────────────────────────────────────────────────────────────────────────────
setting value
version R version 3.6.3 (2020-02-29)
os macOS Catalina 10.15.7
system x86_64, darwin15.6.0
ui X11
language (EN)
collate en_US.UTF-8
ctype en_US.UTF-8
tz America/Chicago
date 2021-03-06
─ Packages ───────────────────────────────────────────────────────────────────────────────────────────────────────────
package * version date lib source
assertthat 0.2.1 2019-03-21 [1] CRAN (R 3.6.0)
BiocManager 1.30.10 2019-11-16 [1] CRAN (R 3.6.0)
BiocStyle * 2.14.4 2020-01-09 [1] Bioconductor
blogdown * 1.2 2021-03-04 [1] CRAN (R 3.6.3)
bookdown 0.21 2020-10-13 [1] CRAN (R 3.6.3)
bslib 0.2.4 2021-01-25 [1] CRAN (R 3.6.2)
cachem 1.0.4 2021-02-13 [1] CRAN (R 3.6.2)
callr 3.5.1 2020-10-13 [1] CRAN (R 3.6.2)
cli 2.3.1 2021-02-23 [1] CRAN (R 3.6.3)
codetools 0.2-18 2020-11-04 [1] CRAN (R 3.6.2)
colorspace 2.0-0 2020-11-11 [1] CRAN (R 3.6.2)
crayon 1.4.1 2021-02-08 [1] CRAN (R 3.6.2)
DBI 1.1.1 2021-01-15 [1] CRAN (R 3.6.2)
desc 1.3.0 2021-03-05 [1] CRAN (R 3.6.3)
devtools * 2.3.2 2020-09-18 [1] CRAN (R 3.6.2)
digest 0.6.27 2020-10-24 [1] CRAN (R 3.6.2)
dplyr 1.0.5 2021-03-05 [1] CRAN (R 3.6.3)
ellipsis 0.3.1 2020-05-15 [1] CRAN (R 3.6.2)
evaluate 0.14 2019-05-28 [1] CRAN (R 3.6.0)
fansi 0.4.2 2021-01-15 [1] CRAN (R 3.6.2)
farver 2.1.0 2021-02-28 [1] CRAN (R 3.6.3)
fastmap 1.1.0 2021-01-25 [1] CRAN (R 3.6.2)
fs 1.5.0 2020-07-31 [1] CRAN (R 3.6.2)
generics 0.1.0 2020-10-31 [1] CRAN (R 3.6.2)
ggplot2 * 3.3.3 2020-12-30 [1] CRAN (R 3.6.2)
ggthemes * 4.2.4 2021-01-20 [1] CRAN (R 3.6.2)
glue 1.4.2 2020-08-27 [1] CRAN (R 3.6.2)
gtable 0.3.0 2019-03-25 [1] CRAN (R 3.6.0)
highr 0.8 2019-03-20 [1] CRAN (R 3.6.0)
htmltools 0.5.1.1 2021-01-22 [1] CRAN (R 3.6.2)
httr 1.4.2 2020-07-20 [1] CRAN (R 3.6.2)
jquerylib 0.1.3 2020-12-17 [1] CRAN (R 3.6.2)
jsonlite 1.7.2 2020-12-09 [1] CRAN (R 3.6.2)
knitcitations * 1.0.12 2021-01-10 [1] CRAN (R 3.6.2)
knitr 1.31 2021-01-27 [1] CRAN (R 3.6.2)
labeling 0.4.2 2020-10-20 [1] CRAN (R 3.6.2)
lifecycle 1.0.0 2021-02-15 [1] CRAN (R 3.6.2)
lubridate 1.7.10 2021-02-26 [1] CRAN (R 3.6.3)
magrittr 2.0.1 2020-11-17 [1] CRAN (R 3.6.2)
memoise 2.0.0 2021-01-26 [1] CRAN (R 3.6.2)
munsell 0.5.0 2018-06-12 [1] CRAN (R 3.6.0)
pillar 1.5.1 2021-03-05 [1] CRAN (R 3.6.3)
pkgbuild 1.2.0 2020-12-15 [1] CRAN (R 3.6.2)
pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 3.6.0)
pkgload 1.2.0 2021-02-23 [1] CRAN (R 3.6.3)
plyr 1.8.6 2020-03-03 [1] CRAN (R 3.6.0)
prettyunits 1.1.1 2020-01-24 [1] CRAN (R 3.6.0)
processx 3.4.5 2020-11-30 [1] CRAN (R 3.6.2)
ps 1.6.0 2021-02-28 [1] CRAN (R 3.6.3)
purrr 0.3.4 2020-04-17 [1] CRAN (R 3.6.2)
R6 2.5.0 2020-10-28 [1] CRAN (R 3.6.2)
Rcpp 1.0.6 2021-01-15 [1] CRAN (R 3.6.2)
RefManageR 1.3.0 2020-11-13 [1] CRAN (R 3.6.2)
remotes 2.2.0 2020-07-21 [1] CRAN (R 3.6.2)
rlang 0.4.10 2020-12-30 [1] CRAN (R 3.6.2)
rmarkdown 2.7 2021-02-19 [1] CRAN (R 3.6.3)
rprojroot 2.0.2 2020-11-15 [1] CRAN (R 3.6.2)
sass 0.3.1 2021-01-24 [1] CRAN (R 3.6.2)
scales 1.1.1 2020-05-11 [1] CRAN (R 3.6.2)
sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 3.6.0)
stringi 1.5.3 2020-09-09 [1] CRAN (R 3.6.2)
stringr 1.4.0 2019-02-10 [1] CRAN (R 3.6.0)
testthat 3.0.2 2021-02-14 [1] CRAN (R 3.6.2)
tibble 3.1.0 2021-02-25 [1] CRAN (R 3.6.3)
tidyselect 1.1.0 2020-05-11 [1] CRAN (R 3.6.2)
usethis * 2.0.1 2021-02-10 [1] CRAN (R 3.6.2)
utf8 1.1.4 2018-05-24 [1] CRAN (R 3.6.0)
vctrs 0.3.6 2020-12-17 [1] CRAN (R 3.6.2)
withr 2.4.1 2021-01-26 [1] CRAN (R 3.6.2)
xfun 0.21 2021-02-10 [1] CRAN (R 3.6.2)
xml2 1.3.2 2020-04-23 [1] CRAN (R 3.6.2)
yaml 2.2.1 2020-02-01 [1] CRAN (R 3.6.0)
[1] /Library/Frameworks/R.framework/Versions/3.6/Resources/library