Task 1

# Create some sample data
x <- 1:15
y <- x + rnorm(15)

# Plot the data
plot(x, y)

# Add a vertical line at x = 2
abline(v = 2)

## We want our code to run and show in a knitted document, we need to place it inside an R code chunk in the R Markdown file. ##

Knitting to PDF or HTML

  • I will be knitting to a HTML fist, because this allows me to convert to a PDF in the future as well. HTML file is easierr to edit and adjust in the future.

  • if we wnat to a creat a PDF after knitting to HTML, we can dowonload it from the browser and print it as a PDF.

The difference between PDF.file and RMD.file

  • PDF file is the final document that can be easily accessed without using R or R studio. More for people to read.
  • RMD file is the source of our project. Where we can easily edit it later if we need to.