title: “MA2611Lab1” author: “Hannah Parisella” date: “2024-03-11” output: html_document: df_print: paged —

highestpointsinus =c(2413, 20310, 12637, 2753, 14505, 14440, 2379, 447, 345, 4784, 13803, 12668, 1235, 1257, 1671, 4041, 4145,535, 5270, 3360, 3489, 1979, 2302, 807, 1772, 12807, 5427, 13147, 6288, 1803, 13167, 5343, 6684, 3508, 1549, 4975, 11249, 3213, 811, 3560, 7244, 6643, 8571, 13534, 4395, 5729, 14417, 4863, 1951, 13809)
max(highestpointsinus)
## [1] 20310
min(highestpointsinus)
## [1] 345
sortedmountains <-sort(highestpointsinus, decreasing = TRUE)
which(sortedmountains==3489)
## [1] 31
summary(highestpointsinus) 
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##     345    2060    4590    6161   10580   20310
z<-seq(from=5, to=-11,by=-0.3)
z 
##  [1]   5.0   4.7   4.4   4.1   3.8   3.5   3.2   2.9   2.6   2.3   2.0   1.7
## [13]   1.4   1.1   0.8   0.5   0.2  -0.1  -0.4  -0.7  -1.0  -1.3  -1.6  -1.9
## [25]  -2.2  -2.5  -2.8  -3.1  -3.4  -3.7  -4.0  -4.3  -4.6  -4.9  -5.2  -5.5
## [37]  -5.8  -6.1  -6.4  -6.7  -7.0  -7.3  -7.6  -7.9  -8.2  -8.5  -8.8  -9.1
## [49]  -9.4  -9.7 -10.0 -10.3 -10.6 -10.9
z <-seq(from=-11,to=5,by=0.3)
z
##  [1] -11.0 -10.7 -10.4 -10.1  -9.8  -9.5  -9.2  -8.9  -8.6  -8.3  -8.0  -7.7
## [13]  -7.4  -7.1  -6.8  -6.5  -6.2  -5.9  -5.6  -5.3  -5.0  -4.7  -4.4  -4.1
## [25]  -3.8  -3.5  -3.2  -2.9  -2.6  -2.3  -2.0  -1.7  -1.4  -1.1  -0.8  -0.5
## [37]  -0.2   0.1   0.4   0.7   1.0   1.3   1.6   1.9   2.2   2.5   2.8   3.1
## [49]   3.4   3.7   4.0   4.3   4.6   4.9
index<-c(z[1], median(z), z[length(z)])
index
## [1] -11.00  -3.05   4.90
v<-c(seq(from=6,to=12,by=1),rep(5.3,times=3,each=1),-3,rep(c(1.2,3.4,5.6),times=2,each=1))
v
##  [1]  6.0  7.0  8.0  9.0 10.0 11.0 12.0  5.3  5.3  5.3 -3.0  1.2  3.4  5.6  1.2
## [16]  3.4  5.6
length(v)
## [1] 17
song_title=c("Cruel Summer","Afterglow","London Boy", "Love Story","Forever&Always","The Best Day","willow","marjorie","tolerate it","...Ready For It?","Last Kiss","The Story of Us","Enchanted","Long Live","22","We Are Never Ever Getting Back Together","Stay Stay Stay","All Too Well","august","Lavender Haze","High Infidelity","Bejeweled","Mastermind")
duration_in_seconds=c(178,222,190,234,225,245,214,257,244,207,369,267,352,317,230,192,204,612,261,201,231,193,190)
album=factor(c("Lover","Lover","Lover","Fearless","Fearless","Fearless","evermore","evermore","evermore","Reputation","Speak Now","Speak Now","Speak Now","Speak Now","Red","Red","Red","Red","folklore","Midnights","Midnights","Midnights","Midnights"))
data.frame(song_title,duration_in_seconds,album)
##                                 song_title duration_in_seconds      album
## 1                             Cruel Summer                 178      Lover
## 2                                Afterglow                 222      Lover
## 3                               London Boy                 190      Lover
## 4                               Love Story                 234   Fearless
## 5                           Forever&Always                 225   Fearless
## 6                             The Best Day                 245   Fearless
## 7                                   willow                 214   evermore
## 8                                 marjorie                 257   evermore
## 9                              tolerate it                 244   evermore
## 10                        ...Ready For It?                 207 Reputation
## 11                               Last Kiss                 369  Speak Now
## 12                         The Story of Us                 267  Speak Now
## 13                               Enchanted                 352  Speak Now
## 14                               Long Live                 317  Speak Now
## 15                                      22                 230        Red
## 16 We Are Never Ever Getting Back Together                 192        Red
## 17                          Stay Stay Stay                 204        Red
## 18                            All Too Well                 612        Red
## 19                                  august                 261   folklore
## 20                           Lavender Haze                 201  Midnights
## 21                         High Infidelity                 231  Midnights
## 22                               Bejeweled                 193  Midnights
## 23                              Mastermind                 190  Midnights
summary(data.frame(song_title,duration_in_seconds,album))
##   song_title        duration_in_seconds       album  
##  Length:23          Min.   :178.0       Midnights:4  
##  Class :character   1st Qu.:202.5       Red      :4  
##  Mode  :character   Median :230.0       Speak Now:4  
##                     Mean   :253.7       evermore :3  
##                     3rd Qu.:259.0       Fearless :3  
##                     Max.   :612.0       Lover    :3  
##                                         (Other)  :2