Principer
In RStudio, choose File > New File > R Markdown…
Choose PDF as your Default Output Format.
Your header should look like this (but with your name and today’s date):
---
title: "R Assignment"
author: "Your Name"
date: "YYYY-MM-DD"
output: pdf_document ---
Now, delete everything below the header. Then, choose Code > Insert Chunk.
Transform the initials of your name into two numbers by their order in the alphabet, 1 for A, 2 for B, 3 for C, etc. For example, if your name is Jane Doe, your two numbers would be 10 and 4. Then, replace the constants 10 and 4 in the function \(f(x)=10\sqrt{x}-4e^{x}\) with your two numbers and plot the function.
Your chunk should look like this (except for the two constants):
```{r}
f<-function(x){10*sqrt(x)-4*exp(x)}
curve(f) ```
Lastly, choose File > Knit Document. Wait a little, while the program produces your PDF-file. The final PDF-document should be one single page and show a formatted header, your name, today’s date and the plot. E-mail the PDF-document to asser.koskinen@hhs.se for review.