R programming

Learning Goal: I’m working on a r multi-part question and need an explanation and answer to help me learn.


For this assignment, name your R file pizza.R

  • For all questions you should load tidyverse. You should not need to use any other libraries.
  • Load tidyverse with suppressPackageStartupMessages(library(tidyverse))
  • Download the pizza.csv file from Brightspace and place it in the same folder/directory as your script file. Then in RStudio, set your Working Directory to your Source File location:
  • Load the pizza.csv file like this:
    pizza <- read_csv(‘pizza.csv’)
  • Round all float/dbl values to two decimal places.
    • If your rounding does not work the way you expect, convert the tibble to a dataframe by using as.data.frame()
  • All statistics should be run with variables in the order I state
    • E.g., “Run a regression predicting mileage from mpg, make, and type” would be:

lm(mileage ~ mpg + make + type…)

  • In each of these you must use at least two dplyr functions. You may use Google to look up how to do certain aspects.

Before attempting to answer these, or if you lose points upon an attempt, please review all CodeGrade information provided in the CodeGrade overview submodule – if you do not you are likely to lose points.


  1. Create a dataframe containing driver names of instances where free_wine = 1, discount_customer = 1, and the order contained more than 4 pizzas. (There will be repeated names).
  • The answers should look like the following:
1 [value]
2 [value]
3 [value]
4 [value]
5 [value]
6 [value]

7 [value]

8 [value]

9 [value]

  • If your CodeGrade output is <fct> instead of <chr>, you can use as.character(driver) to convert it
  • Assign that to Q1
  1. Create a variable that is the ratio of bill to pizza, called ratio. What is the mean of that value (call the value mean_ratio)?
  • Assign this to Q2
  1. For each day of the week, what is the variance in pizzas?
  • The created values should be called var_pizzas.
  • The answer should be assigned to Q3 and show look like the following:
1 Friday [value]
2 Monday [value]
3 Saturday [value]
4 Sunday [value]
5 Thursday [value]
6 Tuesday [value]
7 Wednesday [value]


  1. Which operator had the higher average bill?
  • The answer should be assigned to Q4.
  1. What was the highest amount of free wine given by day/driver combination? (For instance, Friday Bruno was 13, while Wednesday Salvator was 12)
  • The answer should be assigned to Q5 and look like the following:
# A tibble: 1 x 3
# Groups: day, driver [1]
day driver n
<chr> <chr> <int>
1 [day] [name] [value]

Depending on how you do this, you might need to convert a to . You can convert a variable using as.integer().

Calculate your paper price
Pages (550 words)
Approximate price: -

Why Choose Us

Quality Papers

We value our clients. For this reason, we ensure that each paper is written carefully as per the instructions provided by the client. Our editing team also checks all the papers to ensure that they have been completed as per the expectations.

Professional Academic Writers

Over the years, our Acme Homework has managed to secure the most qualified, reliable and experienced team of writers. The company has also ensured continued training and development of the team members to ensure that it keep up with the rising Academic Trends.

Affordable Prices

Our prices are fairly priced in such a way that ensures affordability. Additionally, you can get a free price quotation by clicking on the "Place Order" button.

On-Time delivery

We pay strict attention on deadlines. For this reason, we ensure that all papers are submitted earlier, even before the deadline indicated by the customer. For this reason, the client can go through the work and review everything.

100% Originality

At Buy An Essay, all papers are plagiarism-free as they are written from scratch. We have taken strict measures to ensure that there is no similarity on all papers and that citations are included as per the standards set.

Customer Support 24/7

Our support team is readily available to provide any guidance/help on our platform at any time of the day/night. Feel free to contact us via the Chat window or support email: support@acmehomework.com.

Try it now!

Calculate the price of your order

We'll send you the first draft for approval by at
Total price:

How it works?

Follow these simple steps to get your paper done

Place your order

Fill in the order form and provide all details of your assignment.

Proceed with the payment

Choose the payment system that suits you most.

Receive the final file

Once your paper is ready, we will email it to you.

Our Services

Buy An Essay has stood as the world’s leading custom essay writing services providers. Once you enter all the details in the order form under the place order button, the rest is up to us.


Essay Writing Services

At Buy An Essay, we prioritize on all aspects that bring about a good grade such as impeccable grammar, proper structure, zero-plagiarism and conformance to guidelines. Our experienced team of writers will help you completed your essays and other assignments.


Admission and Business Papers

Be assured that you’ll definitely get accepted to the Master’s level program at any university once you enter all the details in the order form. We won’t leave you here; we will also help you secure a good position in your aspired workplace by creating an outstanding resume or portfolio once you place an order.


Editing and Proofreading

Our skilled editing and writing team will help you restructure you paper, paraphrase, correct grammar and replace plagiarized sections on your paper just on time. The service is geared toward eliminating any mistakes and rather enhancing better quality.


Technical papers

We have writers in almost all fields including the most technical fields. You don’t have to worry about the complexity of your paper. Simply enter as much details as possible in the place order section.