Question
Load the TopGrossingAlbumR.txt file into R and store it as a data frame. Delete the TotalCertified- Copies and ClaimedSales variables from the data frame. (a)
Load the TopGrossingAlbumR.txt file into R and store it as a data frame. Delete the TotalCertified- Copies and ClaimedSales variables from the data frame.
(a) Use the as.Date() function to convert the release date variable into numeric data. Report the release dates listed for the 3 highest grossing albums in Rs default date formatting. What is this value telling you? How does it compare to the corresponding values in SAS?
(b) Create a variable for the days since release of the album. In addition, use the ifelse() function to create a new variable called Era (which should be included as part of the existing data frame). If the release date occurred before 1990, the value of Era should be Classic, whereas if the release date was 1990 or later, it should get a value of Modern. Print the data frame and report the output.
Album | Artist | ReleaseDate | TotalCertifiedCopies | ClaimedSales | Genre |
---|
1 | Thriller | Michael Jackson | November 30, 1982 | 46.3 | 65 | Pop |
2 | Back in Black | AC/DC | July 25, 1980 | 26.1 | 50 | Rock |
3 | The Dark Side of the Moon | Pink Floyd | March 1, 1973 | 24.2 | 45 | Rock |
4 | The Bodyguard: Original Soundtrack Album | Various Artists | November 17, 1992 | 27.4 | 44 | Soundtrack |
5 | Bat Out of Hell | Meat Loaf | October 21, 1977 | 21.5 | 43 | Rock |
6 | Their Greatest Hits (1971-1975) | Eagles | February 17, 1976 | 32.2 | 42 | Rock |
7 | Saturday Night Fever: The Original Movie Sound Track | Various Artists | November 15, 1977 | 20.6 | 40 | Soundtrack |
8 | Rumours | Fleetwood Mac | February 4, 1977 | 27.9 | 40 | Rock |
9 | Come On Over | Shania Twain | November 4, 1997 | 29.6 | 39 | Country |
10 | Led Zeppelin IV | Led Zeppelin | November 8, 1971 | 29.0 | 37 | Rock |
11 | Bad | Michael Jackson | August 31, 1987 | 21.3 | 34 | Pop |
12 | Alanis Morissette | Jagged Little Pill | June 13, 1995 | 24.4 | 33 | Rock |
13 | Falling Into You | Celine Dion | March 8, 1996 | 20.2 | 32 | Pop |
14 | Sgt. Pepper's Lonely Hearts Club Band | The Beatles | May 26, 1967 | 13.1 | 32 | Rock |
15 | Hotel California | Eagles | December 8, 1976 | 21.5 | 32 | Rock |
16 | Dangerous | Michael Jackson | November 26, 1991 | 17.6 | 32 | Pop |
17 | Dirty Dancing | Various Artists | August 4, 1987 | 17.9 | 32 | Soundtrack |
18 | 21 | Adele | January 24, 2011 | 25.3 | 31 | Pop |
19 | Let's Talk About Love | Celine Dion | November 14, 1997 | 19.3 | 31 | Pop |
20 | 1 | The Beatles | November 13, 2000 | 22.6 | 31 | Rock |
21 | The Immaculate Collection | Madonna | November 9, 1990 | 19.4 | 30 | Pop |
22 | Abbey Road | The Beatles | September 26, 1969 | 14.4 | 30 | Rock |
23 | Born in the U.S.A. | Bruce Springsteen | June 4, 1984 | 19.6 | 30 | Rock |
24 | Brothers in Arms | Dire Straits | May 13, 1985 | 17.7 | 30 | Rock |
25 | Titanic: Music from the Motion Picture | James Horner | November 18, 1997 | 18.1 | 30 | Soundtrack |
26 | Metallica | Metallica | August 12, 1991 | 21.2 | 30 | Metal |
27 | Nevermind | Nirvana | September 24, 1991 | 16.7 | 30 | Grunge |
28 | The Wall | Pink Floyd | November 30, 1979 | 17.6 | 30 | Rock |
29 | Supernatural | Santana | June 15, 1999 | 20.5 | 30 | Rock |
30 | Appetite for Destruction | Guns N' Roses | July 21, 1987 | 21.6 | 30 | Metal |
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