Formatting issue when creating page header in rmarkdown

I think there is a conceptual problem: The things you put in includes: in_header: in the yaml are the files included in the preamble of your tex document, similar to what you have in header-includes:. This is not in any way related to the headline of your document.

If you like to change this, have a look at the fancyhdr latex package

Please also note that the syntax for multiline header-includes: is wrong in your example. You need to prefix each line with -

---
title: "Something"
author: "something"
date: "42 42 42"
output: pdf_document
fontsize: 12pt
header-includes:
  - \usepackage{setspace}
  - \onehalfspacing
  - \usepackage{fancyhdr}
  - \fancyhead[c]{your name}
  - \pagestyle{fancy}
  - \setlength{\headheight}{15pt}
---

test

\newpage

test