Hi everyone.
I can't seem to find the answer to my question anywhere.
I have a whole bunch of code to produce various plots for my boss.
When I knit to an HTML it works fine and all the plots show up as they are in R.
When I try to knit to PDF the plots show up fine, but the title and axis labels are missing.
Here is an example of a plot code chunk:
``` {r message=FALSE, echo=FALSE, warning=FALSE}
#GGplot of trend ;
ggplot(dat, aes(migration$Date, Trend)) + geom_line(size=1.2, colour="dodgerblue3") + xlab("Year") + ylab("Number of People (Net)") +
ggtitle("Net Long Term Migration (Arrivals - Departures) Australia - 1976-2018") +
theme(text=element_text(size=14, family="Calibri"), plot.title=element_text(hjust=0.5)) + (scale_x_date(limits=startend))
```
I have attached a side-by-side image of the in R/HTML output and the PDF output.
Also my setup code is as follows:
---
title: ""
author: ""
date: ""
output:
word_document: default
pdf_document:
fig_caption: yes
fig_crop: no
---
Any help would be much appreciated!!