Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In RStudio --- title: Assignment 1 output: word_document --- This assignment is an analysis of weather in Olympia, Washington. It uses daily data from

In RStudio

--- title: "Assignment 1 " output: word_document ---

This assignment is an analysis of weather in Olympia, Washington. It uses daily data from July 1, 1877 to the middle of July 2017. The purpose. You need to use appropriate ggplot2 and dplyr instructions to answer the questions below. ## Load the required libraries.

```{r} library(tidyverse) ```

## Problem 1 The first step is to load the data. The load command in the following chunk works on my computer, but you will have to modify it. Of course before you can do this you need to download the data from the course onto your computer. After that, you can bring it into RStudio with the following steps.

1. Click on "File" 2. Click on "Open File" 3. Navigate to the file and double-click it. 4. Say yes. 5. Copy the command that this process placed in your console. 6. Paste this on top of the command from my system. Leave this command in your first chunk so that it runs everytime you knit.

Run the commands glimpse() and summary() on your file to verify that your import was successful.

```{r}

# The load command below must be run every time you run knitr.

load("~/Dropbox/RProjects/Oly Weather/olywthr.rdata")

glimpse(olywthr) ```

Be careful to keep the R code you need within chunks. Always include the R code and output needed to answer the questions.

## Problem 2 Let's create a small dataframe to work with containing only data from the years 2014 through 2016. Call this dataframe 'recent'. Use the filter() command from dplyr to do this. Run the summary() command to verify that your use of filter() worked correctly. Cite two specific results in the output to support your belief that recent is what you wanted. ```{r} # Place your R code here.

```

## Problem 3 Provide the basic descriptive statistics and a histogram for maximum daily temperature (TMAX) in recent. You can use summary() but you need to add the interquartile range and the standard deviation. Is this distribution symmetric? Make two correct statements about TMAX. Use ggplot2 commands to produce the graphics.

```{r}

# Place the R code you need to answer this question in this chunk.

```

## Problem 5 Applying filter to recent, Create a smaller dataframe (sepoct) containing only observations from the months of September and October. Use summary() to verify your results and cite two items in the output which are consistent with success. Use tapply() with summary() to compare the TMAX values from these two months. Produce a side-by-side boxplot. Make two correct statements to describe your results.

```{r} # Place your R code here.

```

## Problem 6 Use tapply() with summary() to compare the TMAX values from these two months. Produce a side-by-side boxplot. Make two correct statements to describe your results.

```{r} # Place your R code here.

```

## Problem 7 Create a new boolean variable QRain in the dataframe sepoct. If PRCP is greater than 0, the variable should be set to TRUE. Otherwise it should be set to FALSE. Produce a table and a barplot of QRain. Use ggplot2 to create the graphic.

```{r}

# Place the R code you need to answer this question in this chunk.

```

## Problem 8 Produce a table and a mosaicplot to describe the relationship between the variables QRain and mo in the dataframe sepoct. Describe what you see.

```{r}

# Place the R code you need to answer this question in this chunk.

```

## Problem 7 Produce a scatterplot to describe the relationship between TMAX and TMIN using the data in recent. Compute the correlation coefficient. Describe the meaning of the the correlation coefficient. Does it agree with the visual results in the plot?

```{r}

# Place the R code you need to answer this question in this chunk.

```

## Problem 8 Produce a linear model using the dataframe recent which could be used to predict the value of TMIN from a given value of TMAX.

Display the summary results of the linear model.

Use the results of the model to predict the value of TMIN if the value of TMAX is 106. Show the R code you used to make this prediction.

```{r}

# Place the R code you need to answer this question in this chunk.

```

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Next Generation Databases NoSQLand Big Data

Authors: Guy Harrison

1st Edition

1484213300, 978-1484213308

More Books

Students also viewed these Databases questions