I want to change the format of my R Markdown report from HTML to a PDF. I have looked thoroughly online and tried multiple scenarios but none have worked for me. If someone could describe the process in the most simplest way possible that would be greatly appreciated (disclaimer I have seen every question already related to this topic on this site but nothing helped).
Is there a way that I can just input the relevant code to save it to my local documents as a PDF?
Below is the code I am using to format my current R Markdown report -
---
title: Transparency return 2019
author:
date: November 21, 2019
output:
prettydoc::html_pretty:
theme: leonids
highlight: github
---
{r knitr_init, echo=FALSE, cache=FALSE, warning=FALSE}
library(knitr)
library(rmdformats)
## Global options
options(max.print="75")
opts_chunk$set(echo=FALSE,
cache=TRUE,
prompt=FALSE,
tidy=TRUE,
comment=NA,
message=FALSE,
warning=FALSE)
opts_knit$set(width=75)
{r}
library(knitr)
library(rmdformats)
library(ggplot2)
library(dplyr)
library(magick)
library(tidyverse)
library(hrbrthemes)
library(kableExtra)
options(knitr.table.format = "html")
chris <- read.csv("Table set 1.csv")
kable(chris[1:21, 1:6]) %>%
kable_styling("striped", "condensed", font_size = 8) %>%
pack_rows("Full Time", 1, 7) %>%
pack_rows("Part Time", 8, 15) %>%
pack_rows("Apprenticeship", 16, 21)