This is a script saved as .Rmd, on the contrary of r scripts saved as .R.
To knit the script, either use the render function or use the shortcut button in Rstudio.
---
title: "Rstudio exemple of a rmd file"
author: 'stack user'
date: "22 July 2016"
output: html_document
-...