Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question: * The `restaurants` data frame has a variable `GRADE DATE` which `read_csv` interprets as a character variable. * In the code chunk below, add

Question:

* The `restaurants` data frame has a variable `GRADE DATE` which `read_csv` interprets as a character variable. * In the code chunk below, add a new variable `date`, derived from `GRADE DATE`, but so that `restaurants %>% pull(date) %>% class()` gives "Date" and not "character" (there's a check of that in the second code chunk below). * Next, filter out any inspections that do not include a grade (I've provided that code for you.) * Take the resulting data frame, group by date, and summarize the proportion of `GRADE` equal to "A" for each date. + This is a little challenging, but just remember that the proportion will be the sum of the grades that are equal to "A" on each date divided by the total number n of grades on that date. * Finally, make a scatter plot with `date` on the x-axis, the proportion of A's on the y-axis, and include a smooth---that is, include `+ geom_smooth()` in your code for the plot. + If all went well, you should see a noticeable seasonal effect over the seven years represented in the data, as well as a big pandemic-related gap. + Don't worry if you get messages that one row was removed.

Could you please check where is wrong? :

```{r problem 2 b} restaurants <- restaurants |> mutate(GRADE.DATE(date)) restaurants_summarized <- restaurants |> filter(!is.na(GRADE)) |> summarise(GRADE ==A) restaurants_summarized |> ggplot(aes(x=date, y= the proportions of A)+ geom_smooth() ```

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

Cambridge IGCSE And O Level Additional Mathematics Coursebook

Authors: Sue Pemberton

2nd Edition

1108411665, 9781108411660

More Books

Students also viewed these Mathematics questions

Question

How is price established in a monopolistic competitive market?

Answered: 1 week ago

Question

Write a program to check an input year is leap or not.

Answered: 1 week ago

Question

Write short notes on departmentation.

Answered: 1 week ago

Question

What are the factors affecting organisation structure?

Answered: 1 week ago

Question

What are the features of Management?

Answered: 1 week ago

Question

Briefly explain the advantages of 'Management by Objectives'

Answered: 1 week ago

Question

Q 19.3. What are the two kinds of repurchase programs?

Answered: 1 week ago