---
title: "One Template for Quarto Report"
author: "Jihong Zhang"
description: "A template used for academic reporting"
date: "2023-06-27"
categories:
- tutorial
- quarto
format:
html:
code-fold: show
code-overflow: wrap
code-summary: ' R Code'
number-sections: false
---
```{r}
#| eval: true
#| echo: true
library(ggplot2)
library(hexSticker)
p <- ggplot(aes(x = Sepal.Length, y = Sepal.Width), data = iris) +
geom_point(shape = 6, color = "white")
p <- p + theme_void() + theme_transparent()
sticker(p, package="quarto", p_size=20, s_x=1, s_y=.75,
s_width=0.7, s_height = 0.7,
h_fill = "#B4464B", filename="ggplot2.png")
knitr::include_graphics("ggplot2.png")
```
Here's another code for my logo on the sidebar of my website.
```{r}
#| eval: true
#| echo: true
library(hexSticker)
library(ggplot2)
p <- ggplot(data = iris) +
geom_point(aes(x = Sepal.Length, y = Sepal.Width), shape = "M", color = "white", size =8, alpha = 0.3) +
geom_point(aes(x = Petal.Length, y = Petal.Width), shape = "J", color = "black", size =8, alpha = 0.3)
p <- p + theme_void() + theme_transparent()
sticker(p, package="Jihong|Melody", p_size=17, s_x=1, s_y=.75,
s_width=0.9, s_height = 0.9,
p_color = "#c0c0c0",
h_color = "#98A08D",
h_fill = "#008080", filename="images/jihonglogo.png", dpi = 500)
```
``` yaml
#| echo: fenced
title: "NEET Analysis"
author: "Jihong Zhang"
format:
html:
header-includes: |
<link href="https://fonts.googleapis.com/css2?family=Ysabeau+Infant&display=swap" rel="stylesheet">
mainfont: 'Ysabeau Infant'
self-contained: true
toc: true
code-fold: true
code-summary: ' R Code'
code-line-numbers: true
number-sections: true
number-offset: 1
```
```{r}
#| label: setup
#| eval: false
#| message: false
#| warning: false
#| echo: fenced
root_dir = "/Users/clap/OneDrive - The Chinese University of Hong Kong/01_CLAP@JC/LatentClassModel"
knitr::opts_chunk$set(echo = TRUE, message=FALSE, warnings=FALSE, include = FALSE)
knitr::opts_knit$set(root.dir = root_dir)
library(here)
library(glue)
library(bruceR)
library(xtable)
library(formattable) # format styles of table
library(reshape2)
library(tidyverse)
library(ggtext)
library(kableExtra)
library(MplusAutomation)
library(fastDummies)
options(knitr.kable.NA = '')
mycolors = c("#4682B4", "#B4464B", "#B4AF46",
"#1B9E77", "#D95F02", "#7570B3",
"#E7298A", "#66A61E", "#B4F60A")
softcolors = c("#B4464B", "#F3DCD4", "#ECC9C7",
"#D9E3DA", "#D1CFC0", "#C2C2B4")
mykbl <- function(x, ...){
kbl(x, digits = 2, ...) |> kable_styling(bootstrap_options = c("striped", "condensed"))
}
```
### Output example
```{=html}
<iframe width="100%" height="1000" src="data_Preparation_NEET0626.html" title="Quarto Documentation" style="border:2px solid #F3DCD4;"></iframe>
```