STAT 540 Homework 2 (see NOTES at bottom) Look at the file called tennisplayers2018.txt (consisting of data for a number of professional tennis players) on the course web page. Write an R program that will do the following: (1) Read in the data and create an R data frame named tennis.dfr that has the following names for its columns: first.name, last.name, major.match.wins, major.match.losses, overall.match.wins, overall.match.losses, major.titles, overall.titles. (Note that the data file has several explanatory lines before the real data begin that should be skipped when reading in the data lines.) NOTE: For the file name, you must use the following web address (URL): "http://people.stat.sc.edu/hitchcock/tennisplayers2018.txt". Please do not have your code read in the file from your own personal directory. (2) Create and add two more columns called major.winning.pct and overall.winning.pct (showing winning percentage in the "major" and "overall" categories, respectively) to this data frame. Note that "winning percentage" is defined as (match wins)/(match wins + match losses). (3) Sort the data frame by major titles, from most to least. Have your program print the sorted data frame. (4) Perform a nested sort, sorting the data frame first by major titles (from most to least), and then by major winning percentage (from most to least) within major-title levels. Have your program print this sorted data frame. (5) Have R extract the subset of the data frame consisting of players with at least 6 major titles. Call this new data frame: greatest.dfr Have your program print this new data frame. (6) In the most efficient way possible, have R calculate the sample means for each of the numeric variables in the tennis.dfr data set. (Hint: Extract the appropriate subset of the data frame first.) (7) Use the write.table() function to write the data set tennis.dfr to an external file simply called "tennisdata.txt". Make sure the external file includes the column names. Also, make sure the players' names are NOT surrounded by quotes in the external file. NOTE: You MUST intersperse comments (lines that start with #) in your code to explain what your R statements are supposed to be doing. Please be generous with your comments, since you will be graded not only on the correctness of the code, but partially on the clarity of comments. NOTE: PLEASE put WITHIN COMMENTS (in lines that start with #) any text (i.e., if you choose to include problem numbers, problem description, your personal comments, output/results) in your file that is not actual R code. This will make it easier and faster to grade. The grader should be able to copy and paste your entire file into R and have it run correctly. NOTE: Please save your code as a plain text file (.txt file). Submit your solution code via uploading it in Blackboard (instructions are on the course web page). You should use the Chrome or Firefox browser when uploading, not Safari!