Question: 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

Coding in R: This is the dataframe Question: 1.What percentage of courses

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!