Question: Use the accompanying 2012Networks.CSV data file for Assignment 2 to complete the following questions. Network CBS CBS ABC CBS NBC CBS NBC NBC NBC CBS
Use the accompanying 2012Networks.CSV data file for Assignment 2 to complete the following questions.
| Network |
| CBS |
| CBS |
| ABC |
| CBS |
| NBC |
| CBS |
| NBC |
| NBC |
| NBC |
| CBS |
| NBC |
| NBC |
| ABC |
| CBS |
| CBS |
| FOX |
| NBC |
| ABC |
| ABC |
| ABC |
| CBS |
| ABC |
| NBC |
| NBC |
| CBS |
Nielsen Media Research provided the list of the 25 top-rated single shows in television history (The World Almanac, 2012). The data in 2012Networks.CSV show the television network that produced each of these 25 top-rated shows.
2.1 Import/read the provided 2012Networks.CSV data into a variable named networks in RStudio using either the read.csv( ) or read.table( ) function. Remember to specify the arguments for header andsep correctly in the function. Run the variable networks to show the imported result in console. Copy, paste and show both the R commands and imported result in the following space. (5 points)
2.2 Check the data structure of the variable networks using the str( ) function. Show the R command and result in the following space. What is the data structure for this networks variable? And what is the data structure for the Network column/variable in the networks variable? (5 points)
2.3 Construct a frequency distribution using the table( ) function and assign it to a variable named freq.networks. Show the R commands and table result in the following space. (5 points)
2.4 Construct a percent (not relative) frequency distribution using the prop.table( ) function and assign it to a variable named percent.freq.networks. Show the R commands and table result in the following space. (5 points)
2.5 Construct a bar chart for the frequency distribution using the barplot( ) function. In the bar chart, make the main title as Bar chart of TV networks, x axis label as Network, y axis label as Frequency, and the color for the bars as green. Show the R command and bar chart in the following space. (10 points)
(Hint: to save the bar chart image, in the bottom right pane in RStudio, go to the Plots tab Export Save as Image, choose the image format as PNG or JPEG, give a file name, choose a directory/folder to save the image, then click the Save button. Then copy and paste the saved image in the following space.)
2.6 Which network or networks have done the best in terms of presenting top-rated television shows? Compare the performance of ABC, CBS, and NBC. (5 points)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
