# Collapse line spacing between items in the preamble of an r markdown pdf output to single spacing

I'm starting to explore Latex right now, working with Rstudio and using an r markdown file to produce a report in pdf format. I would like to find a way to adjust the spaces between lines of the title, author and date to single spacing. Thanks

---
output:
pdf_document:
latex_engine: xelatex
mainfont: Cambria
documentclass: article
classoption:
- portrait
- a4paper
geometry: "left=2cm,right=2cm,top=2cm,bottom=2cm"
- \usepackage{titling}
- \pretitle{\begin{flushleft}\large\bfseries}
- \posttitle{\end{flushleft}}
- \preauthor{\begin{flushleft}\large}
- \postauthor{\end{flushleft}}
- \predate{\begin{flushleft}\large}
- \postdate{\end{flushleft}}
- \usepackage{setspace}\singlespacing
title: "This is my title"
subtitle: "Lorem ipsum"
author: "dolor sit amet"
date: "r format(Sys.time(), '%d/%m/%Y - %X')"
fontsize: 10pt
---
{r setup, include=FALSE}
knitr::opts_chunk\$set(echo = TRUE)

\vspace{-1cm}
\rule{\linewidth}{0.4pt}

\nointerlineskip
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
\nointerlineskip
\rule{\linewidth}{0.4pt}


The desired output would be like this: