Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Coding in R: This is the dataframe Question: 1.What percentage of courses required students to purchase more than 1 book? Write R code that would

Coding in R: This is the dataframe

image text in transcribed

Question:

1.What percentage of courses required students to purchase more than 1 book? Write R code that would give you the answer to this question. Round your answer to 2 decimal places and save your answer (the percentage) to a variable called moreThanOneBook.

2. Although they tell us the total cost of textbooks for a course, we cannot tell how much each individual book in the course cost students. Lets say we want to create a new variable called averageBookCost in this TextbookCosts data frame. We can calculate this by taking the total cost and dividing by the number of books required. Write code to create such a variable in this data frame. After you've verified the code works as intended, remember to save that variable to your TextbookCosts dataframe.

3. If you look at the histogram for Cost, youll see that the most expensive course costs nearly $250. What Field is that course in? Save your answer to a variable called expensiveClass.

In [26]: # Write some code here. TextbookCosts A data.frame: 40 x 3 Field Books Cost sint> Social Science 3 77 Natural Science 2 231 NaturalScience 1 189 Social Science 6 85 Natural Science 1 113 Humanities 9 132 Social Science 2 199 Social Science 1 161 Humanities 3 213 Arts 1 131 Arts 1 133 Arts 6 118 Social Science 9 197 Social Science 3 95 Social Science 2 73 Social Science 1 115 Natural Science 1 110 Social Science 2 87 Humanities 3 223 Humanities 5 74 In [26]: # Write some code here. TextbookCosts A data.frame: 40 x 3 Field Books Cost sint> Social Science 3 77 Natural Science 2 231 NaturalScience 1 189 Social Science 6 85 Natural Science 1 113 Humanities 9 132 Social Science 2 199 Social Science 1 161 Humanities 3 213 Arts 1 131 Arts 1 133 Arts 6 118 Social Science 9 197 Social Science 3 95 Social Science 2 73 Social Science 1 115 Natural Science 1 110 Social Science 2 87 Humanities 3 223 Humanities 5 74

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

SQL Database Programming

Authors: Chris Fehily

1st Edition

1937842312, 978-1937842314

More Books

Students also viewed these Databases questions

Question

1. Identify outcomes (e.g., quality, accidents).

Answered: 1 week ago