39 Assignment 1
The goal of this assignment is to introduce you to R, RStudio, and R markdown. We will be using these three programs throughout the course. You will be using these programs to make assignments (and other documents) that involve reporting the results obtained from R easily reproducible. In the most basic sense, this is equivalent to “showing your work” as you would for assignments with analytical components.
As I mentioned in class, using R, RStudio, and R markdown is not required for this class. You are free to use whatever programing language you are familiar with as long as it is capable of doing basic statistical functions and making documents that enable your work to be reproducible. If you do not plan on using R, RStudio, and R markdown, please send me an email (thefley@ksu.edu) that explains what software you are using and why you want to use it. I do reserve the right to deny the use of certain software if I think it is incapable of doing what is required for this class. If you choose not to use R, RStudio, and R markdown, you must complete the assignment using the software of your choice.
Install R and RStudio. Please see the resources page on the course website for links to download the software.
In RStudio, create a new R Markdown file. Change the default output format to PDF.
Within the new R markdown file, delete the existing code and text (be carful to retain the top four lines which R markdown requires). Using the code below, download the annual \(\text{CO}_{2}\) concentrations from Mt. Loa. With the code provided, plot the data.
<- "ftp://aftp.cmdl.noaa.gov/products/trends/co2/co2_annmean_mlo.txt"
url <- read.table(url,header=FALSE)
df colnames(df) <- c("year","meanCO2","unc")
plot(x = df$year, y = df$meanCO2, xlab = "Year", ylab = expression("Mean annual "*CO[2]*" concentration"), main="your name here",col="blue")
- Change the plot title from “your name here” to your actual name. Change the color of the points from blue to a color of your choice. Knit the file to HTML or pdf and save the file as Yourlastname_Assignment1 (e.g., Hefley_Assignment1). Upload this file to Canvas by 11:59 pm on Monday 6/12/2023.