Assignment A

Prepare File

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: "Assignment A"
author: "Your Name"
date: "YYYY-MM-DD"
output: pdf_document
---

Select File > Save as… and save your document locally on your computer. Choose a folder that you can easily find. Do not use a cloud service to save your file. Suggested file name: R Assignment A.Rmd

Create Plot

Now, delete everything below the header (header = the code above). 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)
```

Hand In

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 for review. As e-mail subject, write R Assignment A.

Need more help? Please visit our video channel on Kaltura/SSE Play.