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
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
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started