-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.R
404 lines (355 loc) · 25.2 KB
/
index.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
# This file uses the orginal Billboard song name and Spotify ID chart to get the song's features
# danceability, energy etc from Spotify.
install.packages("devtools")
install_github("tiagomendesdantas/Rspotify")
library(devtools)
library(Rspotify)
library(dplyr)
## Set Working Directory
# setwd("~/Documents/Info 201/info_201_final_project")
#setwd("C:/Users/Austin Quach/Google Drive/College/Sophomore/Info 201/Homework/info_201_final_project")
setwd('/Users/abc/Documents/college/INFO201/info_201_final_project')
songs.2016 <- read.csv("Songs/Songs - 2016.csv")
songs.2015 <- read.csv("Songs/Songs - 2015.csv")
songs.2014 <- read.csv("Songs/Songs - 2014.csv")
songs.2013 <- read.csv("Songs/Songs - 2013.csv")
songs.2012 <- read.csv("Songs/Songs - 2012.csv")
songs.2011 <- read.csv("Songs/Songs - 2011.csv")
songs.2010 <- read.csv("Songs/Songs - 2010.csv")
songs.2009 <- read.csv("Songs/Songs - 2009.csv")
songs.2008 <- read.csv("Songs/Songs - 2008.csv")
songs.2007 <- read.csv("Songs/Songs - 2007.csv")
songs.2006 <- read.csv("Songs/Songs - 2006.csv")
songs.2005 <- read.csv("Songs/Songs - 2005.csv")
songs.2004 <- read.csv("Songs/Songs - 2004.csv")
songs.2003 <- read.csv("Songs/Songs - 2003.csv")
songs.2002 <- read.csv("Songs/Songs - 2002.csv")
songs.2001 <- read.csv("Songs/Songs - 2001.csv")
songs.2000 <- read.csv("Songs/Songs - 2000.csv")
songs.1999 <- read.csv("Songs/Songs - 1999.csv")
songs.1998 <- read.csv("Songs/Songs - 1998.csv")
songs.1997 <- read.csv("Songs/Songs - 1997.csv")
songs.1996 <- read.csv("Songs/Songs - 1996.csv")
songs.1995 <- read.csv("Songs/Songs - 1995.csv")
songs.1994 <- read.csv("Songs/Songs - 1994.csv")
songs.1993 <- read.csv("Songs/Songs - 1993.csv")
songs.1992 <- read.csv("Songs/Songs - 1992.csv")
songs.1991 <- read.csv("Songs/Songs - 1991.csv")
songs.1990 <- read.csv("Songs/Songs - 1990.csv")
songs.1989 <- read.csv("Songs/Songs - 1989.csv")
songs.1988 <- read.csv("Songs/Songs - 1988.csv")
songs.1987 <- read.csv("Songs/Songs - 1987.csv")
songs.1986 <- read.csv("Songs/Songs - 1986.csv")
songs.1985 <- read.csv("Songs/Songs - 1985.csv")
songs.1984 <- read.csv("Songs/Songs - 1984.csv")
songs.1983 <- read.csv("Songs/Songs - 1983.csv")
songs.1982 <- read.csv("Songs/Songs - 1982.csv")
songs.1981 <- read.csv("Songs/Songs - 1981.csv")
songs.1980 <- read.csv("Songs/Songs - 1980.csv")
keys <- spotifyOAuth("Info 201","ae706b417cc645f78c559186204dadd4","5f5769652ae24ceca43e05074b8b84eb")
source("functions/GetSongData.R")
## Merging audio features and songs together
merge.2016 <- features.2016 %>%
mutate(Spotify.ID = id) %>%
left_join(songs.2016, by = 'Spotify.ID') %>%
select(Song, Artist, Year, Spotify.ID, danceability, energy, tempo, loudness, speechiness, acousticness, instrumentalness, liveness, duration_ms)
merge.2015 <- features.2015 %>%
mutate(Spotify.ID= id) %>%
left_join(songs.2015, by = 'Spotify.ID') %>%
select(Song, Artist, Year, Spotify.ID, danceability, energy, tempo, loudness, speechiness, acousticness, instrumentalness, liveness, duration_ms)
merge.2014 <- features.2014 %>%
mutate(Spotify.ID = id) %>%
left_join(songs.2014, by = 'Spotify.ID') %>%
select(Song, Artist, Year, Spotify.ID, danceability, energy, tempo, loudness, speechiness, acousticness, instrumentalness, liveness, duration_ms)
merge.2013 <- features.2013 %>%
mutate(Spotify.ID = id) %>%
left_join(songs.2013, by = 'Spotify.ID') %>%
select(Song, Artist, Year, Spotify.ID, danceability, energy, tempo, loudness, speechiness, acousticness, instrumentalness, liveness, duration_ms)
merge.2012 <- features.2012 %>%
mutate(Spotify.ID = id) %>%
left_join(songs.2012, by = 'Spotify.ID') %>%
select(Song, Artist, Year, Spotify.ID, danceability, energy, tempo, loudness, speechiness, acousticness, instrumentalness, liveness, duration_ms)
merge.2011 <- features.2011 %>%
mutate(Spotify.ID = id) %>%
left_join(songs.2011, by = 'Spotify.ID') %>%
select(Song, Artist, Year, Spotify.ID, danceability, energy, tempo, loudness, speechiness, acousticness, instrumentalness, liveness, duration_ms)
merge.2010 <- features.2010 %>%
mutate(Spotify.ID = id) %>%
left_join(songs.2010, by = 'Spotify.ID') %>%
select(Song, Artist, Year, Spotify.ID, danceability, energy, tempo, loudness, speechiness, acousticness, instrumentalness, liveness, duration_ms)
merge.2009 <- features.2009 %>%
mutate(Spotify.ID = id) %>%
left_join(songs.2009, by = 'Spotify.ID') %>%
select(Song, Artist, Year, Spotify.ID, danceability, energy, tempo, loudness, speechiness, acousticness, instrumentalness, liveness, duration_ms)
merge.2008 <- features.2008 %>%
mutate(Spotify.ID = id) %>%
left_join(songs.2008, by = 'Spotify.ID') %>%
select(Song, Artist, Year, Spotify.ID, danceability, energy, tempo, loudness, speechiness, acousticness, instrumentalness, liveness, duration_ms)
merge.2007 <- features.2007 %>%
mutate(Spotify.ID = id) %>%
left_join(songs.2007, by = 'Spotify.ID') %>%
select(Song, Artist, Year, Spotify.ID, danceability, energy, tempo, loudness, speechiness, acousticness, instrumentalness, liveness, duration_ms)
merge.2006 <- features.2006 %>%
mutate(Spotify.ID = id) %>%
left_join(songs.2006, by = 'Spotify.ID') %>%
select(Song, Artist, Year, Spotify.ID, danceability, energy, tempo, loudness, speechiness, acousticness, instrumentalness, liveness, duration_ms)
merge.2005 <- features.2005 %>%
mutate(Spotify.ID = id) %>%
left_join(songs.2005, by = 'Spotify.ID') %>%
select(Song, Artist, Year, Spotify.ID, danceability, energy, tempo, loudness, speechiness, acousticness, instrumentalness, liveness, duration_ms)
merge.2004 <- features.2004 %>%
mutate(Spotify.ID = id) %>%
left_join(songs.2004, by = 'Spotify.ID') %>%
select(Song, Artist, Year, Spotify.ID, danceability, energy, tempo, loudness, speechiness, acousticness, instrumentalness, liveness, duration_ms)
merge.2003 <- features.2003 %>%
mutate(Spotify.ID = id) %>%
left_join(songs.2003, by = 'Spotify.ID') %>%
select(Song, Artist, Year, Spotify.ID, danceability, energy, tempo, loudness, speechiness, acousticness, instrumentalness, liveness, duration_ms)
merge.2002 <- features.2002 %>%
mutate(Spotify.ID = id) %>%
left_join(songs.2002, by = 'Spotify.ID') %>%
select(Song, Artist, Year, Spotify.ID, danceability, energy, tempo, loudness, speechiness, acousticness, instrumentalness, liveness, duration_ms)
merge.2001 <- features.2001 %>%
mutate(Spotify.ID = id) %>%
left_join(songs.2001, by = 'Spotify.ID') %>%
select(Song, Artist, Year, Spotify.ID, danceability, energy, tempo, loudness, speechiness, acousticness, instrumentalness, liveness, duration_ms)
merge.2000 <- features.2000 %>%
mutate(Spotify.ID = id) %>%
left_join(songs.2000, by = 'Spotify.ID') %>%
select(Song, Artist, Year, Spotify.ID, danceability, energy, tempo, loudness, speechiness, acousticness, instrumentalness, liveness, duration_ms)
merge.1999 <- features.1999 %>%
mutate(Spotify.ID = id) %>%
left_join(songs.1999, by = 'Spotify.ID') %>%
select(Song, Artist, Year, Spotify.ID, danceability, energy, tempo, loudness, speechiness, acousticness, instrumentalness, liveness, duration_ms)
merge.1998 <- features.1998 %>%
mutate(Spotify.ID = id) %>%
left_join(songs.1998, by = 'Spotify.ID') %>%
select(Song, Artist, Year, Spotify.ID, danceability, energy, tempo, loudness, speechiness, acousticness, instrumentalness, liveness, duration_ms)
merge.1997 <- features.1997 %>%
mutate(Spotify.ID = id) %>%
left_join(songs.1997, by = 'Spotify.ID') %>%
select(Song, Artist, Year, Spotify.ID, danceability, energy, tempo, loudness, speechiness, acousticness, instrumentalness, liveness, duration_ms)
merge.1996 <- features.1996 %>%
mutate(Spotify.ID = id) %>%
left_join(songs.1996, by = 'Spotify.ID') %>%
select(Song, Artist, Year, Spotify.ID, danceability, energy, tempo, loudness, speechiness, acousticness, instrumentalness, liveness, duration_ms)
merge.1995 <- features.1995 %>%
mutate(Spotify.ID = id) %>%
left_join(songs.1995, by = 'Spotify.ID') %>%
select(Song, Artist, Year, Spotify.ID, danceability, energy, tempo, loudness, speechiness, acousticness, instrumentalness, liveness, duration_ms)
merge.1994 <- features.1994 %>%
mutate(Spotify.ID = id) %>%
left_join(songs.1994, by = 'Spotify.ID') %>%
select(Song, Artist, Year, Spotify.ID, danceability, energy, tempo, loudness, speechiness, acousticness, instrumentalness, liveness, duration_ms)
merge.1993 <- features.1993 %>%
mutate(Spotify.ID = id) %>%
left_join(songs.1993, by = 'Spotify.ID') %>%
select(Song, Artist, Year, Spotify.ID, danceability, energy, tempo, loudness, speechiness, acousticness, instrumentalness, liveness, duration_ms)
merge.1992 <- features.1992 %>%
mutate(Spotify.ID = id) %>%
left_join(songs.1992, by = 'Spotify.ID') %>%
select(Song, Artist, Year, Spotify.ID, danceability, energy, tempo, loudness, speechiness, acousticness, instrumentalness, liveness, duration_ms)
merge.1991 <- features.1991 %>%
mutate(Spotify.ID = id) %>%
left_join(songs.1991, by = 'Spotify.ID') %>%
select(Song, Artist, Year, Spotify.ID, danceability, energy, tempo, loudness, speechiness, acousticness, instrumentalness, liveness, duration_ms)
merge.1990 <- features.1990 %>%
mutate(Spotify.ID = id) %>%
left_join(songs.1990, by = 'Spotify.ID') %>%
select(Song, Artist, Year, Spotify.ID, danceability, energy, tempo, loudness, speechiness, acousticness, instrumentalness, liveness, duration_ms)
merge.1989 <- features.1989 %>%
mutate(Spotify.ID = id) %>%
left_join(songs.1989, by = 'Spotify.ID') %>%
select(Song, Artist, Year, Spotify.ID, danceability, energy, tempo, loudness, speechiness, acousticness, instrumentalness, liveness, duration_ms)
merge.1988 <- features.1988 %>%
mutate(Spotify.ID = id) %>%
left_join(songs.1988, by = 'Spotify.ID') %>%
select(Song, Artist, Year, Spotify.ID, danceability, energy, tempo, loudness, speechiness, acousticness, instrumentalness, liveness, duration_ms)
merge.1987 <- features.1987 %>%
mutate(Spotify.ID = id) %>%
left_join(songs.1987, by = 'Spotify.ID') %>%
select(Song, Artist, Year, Spotify.ID, danceability, energy, tempo, loudness, speechiness, acousticness, instrumentalness, liveness, duration_ms)
merge.1986 <- features.1986 %>%
mutate(Spotify.ID = id) %>%
left_join(songs.1986, by = 'Spotify.ID') %>%
select(Song, Artist, Year, Spotify.ID, danceability, energy, tempo, loudness, speechiness, acousticness, instrumentalness, liveness, duration_ms)
merge.1985 <- features.1985 %>%
mutate(Spotify.ID = id) %>%
left_join(songs.1985, by = 'Spotify.ID') %>%
select(Song, Artist, Year, Spotify.ID, danceability, energy, tempo, loudness, speechiness, acousticness, instrumentalness, liveness, duration_ms)
merge.1984 <- features.1984 %>%
mutate(Spotify.ID = id) %>%
left_join(songs.1984, by = 'Spotify.ID') %>%
select(Song, Artist, Year, Spotify.ID, danceability, energy, tempo, loudness, speechiness, acousticness, instrumentalness, liveness, duration_ms)
merge.1983 <- features.1983 %>%
mutate(Spotify.ID = id) %>%
left_join(songs.1983, by = 'Spotify.ID') %>%
select(Song, Artist, Year, Spotify.ID, danceability, energy, tempo, loudness, speechiness, acousticness, instrumentalness, liveness, duration_ms)
merge.1982 <- features.1982 %>%
mutate(Spotify.ID = id) %>%
left_join(songs.1982, by = 'Spotify.ID') %>%
select(Song, Artist, Year, Spotify.ID, danceability, energy, tempo, loudness, speechiness, acousticness, instrumentalness, liveness, duration_ms)
merge.1981 <- features.1981 %>%
mutate(Spotify.ID = id) %>%
left_join(songs.1981, by = 'Spotify.ID') %>%
select(Song, Artist, Year, Spotify.ID, danceability, energy, tempo, loudness, speechiness, acousticness, instrumentalness, liveness, duration_ms)
merge.1980 <- features.1980 %>%
mutate(Spotify.ID = id) %>%
left_join(songs.1980, by = 'Spotify.ID') %>%
select(Song, Artist, Year, Spotify.ID, danceability, energy, tempo, loudness, speechiness, acousticness, instrumentalness, liveness, duration_ms)
write.csv(merge.2016, file="songsMerged/songs.merged.2016.csv")
write.csv(merge.2015, file="songsMerged/songs.merged.2015.csv")
write.csv(merge.2014, file="songsMerged/songs.merged.2014.csv")
write.csv(merge.2013, file="songsMerged/songs.merged.2013.csv")
write.csv(merge.2012, file="songsMerged/songs.merged.2012.csv")
write.csv(merge.2011, file="songsMerged/songs.merged.2011.csv")
write.csv(merge.2010, file="songsMerged/songs.merged.2010.csv")
write.csv(merge.2009, file="songsMerged/songs.merged.2009.csv")
write.csv(merge.2008, file="songsMerged/songs.merged.2008.csv")
write.csv(merge.2007, file="songsMerged/songs.merged.2007.csv")
write.csv(merge.2006, file="songsMerged/songs.merged.2006.csv")
write.csv(merge.2005, file="songsMerged/songs.merged.2005.csv")
write.csv(merge.2004, file="songsMerged/songs.merged.2004.csv")
write.csv(merge.2003, file="songsMerged/songs.merged.2003.csv")
write.csv(merge.2002, file="songsMerged/songs.merged.2002.csv")
write.csv(merge.2001, file="songsMerged/songs.merged.2001.csv")
write.csv(merge.2000, file="songsMerged/songs.merged.2000.csv")
write.csv(merge.1999, file="songsMerged/songs.merged.1999.csv")
write.csv(merge.1998, file="songsMerged/songs.merged.1998.csv")
write.csv(merge.1997, file="songsMerged/songs.merged.1997.csv")
write.csv(merge.1996, file="songsMerged/songs.merged.1996.csv")
write.csv(merge.1995, file="songsMerged/songs.merged.1995.csv")
write.csv(merge.1994, file="songsMerged/songs.merged.1994.csv")
write.csv(merge.1993, file="songsMerged/songs.merged.1993.csv")
write.csv(merge.1992, file="songsMerged/songs.merged.1992.csv")
write.csv(merge.1991, file="songsMerged/songs.merged.1991.csv")
write.csv(merge.1990, file="songsMerged/songs.merged.1990.csv")
write.csv(merge.1989, file="songsMerged/songs.merged.1989.csv")
write.csv(merge.1988, file="songsMerged/songs.merged.1988.csv")
write.csv(merge.1987, file="songsMerged/songs.merged.1987.csv")
write.csv(merge.1986, file="songsMerged/songs.merged.1986.csv")
write.csv(merge.1985, file="songsMerged/songs.merged.1985.csv")
write.csv(merge.1984, file="songsMerged/songs.merged.1984.csv")
write.csv(merge.1983, file="songsMerged/songs.merged.1983.csv")
write.csv(merge.1982, file="songsMerged/songs.merged.1982.csv")
write.csv(merge.1981, file="songsMerged/songs.merged.1981.csv")
write.csv(merge.1980, file="songsMerged/songs.merged.1980.csv")
## Everything merged together
merged.all.features <- rbind(merge.2016, merge.2015, merge.2014, merge.2013, merge.2012, merge.2011, merge.2010, merge.2009, merge.2008, merge.2007, merge.2006, merge.2005, merge.2004, merge.2003, merge.2002, merge.2001, merge.2000,
merge.1999, merge.1998, merge.1997, merge.1996, merge.1995, merge.1994, merge.1993, merge.1992, merge.1991, merge.1990,
merge.1989, merge.1988, merge.1987, merge.1986, merge.1985, merge.1984, merge.1983, merge.1982, merge.1981, merge.1980)
write.csv(merged.all.features, file = "songsMerged/songs.merged.all.csv")
## Grabbing audio features
features.2016 <- as.data.frame(do.call(rbind, lapply(songs.2016$Spotify.ID, getAudioFeatures) ))
features.2015 <- as.data.frame(do.call(rbind, lapply(songs.2015$Spotify.ID, getAudioFeatures) ))
features.2014 <- as.data.frame(do.call(rbind, lapply(songs.2014$Spotify.ID, getAudioFeatures) ))
features.2013 <- as.data.frame(do.call(rbind, lapply(songs.2013$Spotify.ID, getAudioFeatures) ))
features.2012 <- as.data.frame(do.call(rbind, lapply(songs.2012$Spotify.ID, getAudioFeatures) ))
features.2011 <- as.data.frame(do.call(rbind, lapply(songs.2011$Spotify.ID, getAudioFeatures) ))
features.2010 <- as.data.frame(do.call(rbind, lapply(songs.2010$Spotify.ID, getAudioFeatures) ))
features.2009 <- as.data.frame(do.call(rbind, lapply(songs.2009$Spotify.ID, getAudioFeatures) ))
features.2008 <- as.data.frame(do.call(rbind, lapply(songs.2008$Spotify.ID, getAudioFeatures) ))
features.2007 <- as.data.frame(do.call(rbind, lapply(songs.2007$Spotify.ID, getAudioFeatures) ))
features.2006 <- as.data.frame(do.call(rbind, lapply(songs.2006$Spotify.ID, getAudioFeatures) ))
features.2005 <- as.data.frame(do.call(rbind, lapply(songs.2005$Spotify.ID, getAudioFeatures) ))
features.2004 <- as.data.frame(do.call(rbind, lapply(songs.2004$Spotify.ID, getAudioFeatures) ))
features.2003 <- as.data.frame(do.call(rbind, lapply(songs.2003$Spotify.ID, getAudioFeatures) ))
features.2002 <- as.data.frame(do.call(rbind, lapply(songs.2002$Spotify.ID, getAudioFeatures) ))
features.2001 <- as.data.frame(do.call(rbind, lapply(songs.2001$Spotify.ID, getAudioFeatures) ))
features.2000 <- as.data.frame(do.call(rbind, lapply(songs.2000$Spotify.ID, getAudioFeatures) ))
features.1999 <- as.data.frame(do.call(rbind, lapply(songs.1999$Spotify.ID, getAudioFeatures) ))
features.1998 <- as.data.frame(do.call(rbind, lapply(songs.1998$Spotify.ID, getAudioFeatures) ))
features.1997 <- as.data.frame(do.call(rbind, lapply(songs.1997$Spotify.ID, getAudioFeatures) ))
features.1996 <- as.data.frame(do.call(rbind, lapply(songs.1996$Spotify.ID, getAudioFeatures) ))
features.1995 <- as.data.frame(do.call(rbind, lapply(songs.1995$Spotify.ID, getAudioFeatures) ))
features.1994 <- as.data.frame(do.call(rbind, lapply(songs.1994$Spotify.ID, getAudioFeatures) ))
features.1993 <- as.data.frame(do.call(rbind, lapply(songs.1993$Spotify.ID, getAudioFeatures) ))
features.1992 <- as.data.frame(do.call(rbind, lapply(songs.1992$Spotify.ID, getAudioFeatures) ))
features.1991 <- as.data.frame(do.call(rbind, lapply(songs.1991$Spotify.ID, getAudioFeatures) ))
features.1990 <- as.data.frame(do.call(rbind, lapply(songs.1990$Spotify.ID, getAudioFeatures) ))
features.1989 <- as.data.frame(do.call(rbind, lapply(songs.1989$Spotify.ID, getAudioFeatures) ))
features.1988 <- as.data.frame(do.call(rbind, lapply(songs.1988$Spotify.ID, getAudioFeatures) ))
features.1987 <- as.data.frame(do.call(rbind, lapply(songs.1987$Spotify.ID, getAudioFeatures) ))
features.1986 <- as.data.frame(do.call(rbind, lapply(songs.1986$Spotify.ID, getAudioFeatures) ))
features.1985 <- as.data.frame(do.call(rbind, lapply(songs.1985$Spotify.ID, getAudioFeatures) ))
features.1984 <- as.data.frame(do.call(rbind, lapply(songs.1984$Spotify.ID, getAudioFeatures) ))
features.1983 <- as.data.frame(do.call(rbind, lapply(songs.1983$Spotify.ID, getAudioFeatures) ))
features.1982 <- as.data.frame(do.call(rbind, lapply(songs.1982$Spotify.ID, getAudioFeatures) ))
features.1981 <- as.data.frame(do.call(rbind, lapply(songs.1981$Spotify.ID, getAudioFeatures) ))
features.1980 <- as.data.frame(do.call(rbind, lapply(songs.1980$Spotify.ID, getAudioFeatures) ))
## Grabbing audio features for the years and putting them into respective data frames
features.2016 <- read.csv("features/features.2016.csv")
features.2015 <- read.csv("features/features.2015.csv")
features.2014 <- read.csv("features/features.2014.csv")
features.2013 <- read.csv("features/features.2013.csv")
features.2012 <- read.csv("features/features.2012.csv")
features.2011 <- read.csv("features/features.2011.csv")
features.2010 <- read.csv("features/features.2010.csv")
features.2009 <- read.csv("features/features.2009.csv")
features.2008 <- read.csv("features/features.2008.csv")
features.2007 <- read.csv("features/features.2007.csv")
features.2006 <- read.csv("features/features.2006.csv")
features.2005 <- read.csv("features/features.2005.csv")
features.2004 <- read.csv("features/features.2004.csv")
features.2003 <- read.csv("features/features.2003.csv")
features.2002 <- read.csv("features/features.2002.csv")
features.2001 <- read.csv("features/features.2001.csv")
features.2000 <- read.csv("features/features.2000.csv")
features.1999 <- read.csv("features/features.1999.csv")
features.1998 <- read.csv("features/features.1998.csv")
features.1997 <- read.csv("features/features.1997.csv")
features.1996 <- read.csv("features/features.1996.csv")
features.1995 <- read.csv("features/features.1995.csv")
features.1994 <- read.csv("features/features.1994.csv")
features.1993 <- read.csv("features/features.1993.csv")
features.1992 <- read.csv("features/features.1992.csv")
features.1991 <- read.csv("features/features.1991.csv")
features.1990 <- read.csv("features/features.1990.csv")
features.1989 <- read.csv("features/features.1989.csv")
features.1988 <- read.csv("features/features.1988.csv")
features.1987 <- read.csv("features/features.1987.csv")
features.1986 <- read.csv("features/features.1986.csv")
features.1985 <- read.csv("features/features.1985.csv")
features.1984 <- read.csv("features/features.1984.csv")
features.1983 <- read.csv("features/features.1983.csv")
features.1982 <- read.csv("features/features.1982.csv")
features.1981 <- read.csv("features/features.1981.csv")
features.1980 <- read.csv("features/features.1980.csv")
## Writing audio features to a file
write.csv(as.data.frame(do.call(rbind, lapply(songs.2016[["Spotify.ID"]], getAudioFeatures) )), file="features/features.2016.csv")
write.csv(as.data.frame(do.call(rbind, lapply(songs.2015[["Spotify.ID"]], getAudioFeatures) )), file="features/features.2015.csv")
write.csv(as.data.frame(do.call(rbind, lapply(songs.2014[["Spotify.ID"]], getAudioFeatures) )), file="features/features.2014.csv")
write.csv(as.data.frame(do.call(rbind, lapply(songs.2013[["Spotify.ID"]], getAudioFeatures) )), file="features/features.2013.csv")
write.csv(as.data.frame(do.call(rbind, lapply(songs.2012[["Spotify.ID"]], getAudioFeatures) )), file="features/features.2012.csv")
write.csv(as.data.frame(do.call(rbind, lapply(songs.2011[["Spotify.ID"]], getAudioFeatures) )), file="features/features.2011.csv")
write.csv(as.data.frame(do.call(rbind, lapply(songs.2010[["Spotify.ID"]], getAudioFeatures) )), file="features/features.2010.csv")
write.csv(as.data.frame(do.call(rbind, lapply(songs.2009[["Spotify.ID"]], getAudioFeatures) )), file="features/features.2009.csv")
write.csv(as.data.frame(do.call(rbind, lapply(songs.2008[["Spotify.ID"]], getAudioFeatures) )), file="features/features.2008.csv")
write.csv(as.data.frame(do.call(rbind, lapply(songs.2007[["Spotify.ID"]], getAudioFeatures) )), file="features/features.2007.csv")
write.csv(as.data.frame(do.call(rbind, lapply(songs.2006[["Spotify.ID"]], getAudioFeatures) )), file="features/features.2006.csv")
write.csv(as.data.frame(do.call(rbind, lapply(songs.2005[["Spotify.ID"]], getAudioFeatures) )), file="features/features.2005.csv")
write.csv(as.data.frame(do.call(rbind, lapply(songs.2004[["Spotify.ID"]], getAudioFeatures) )), file="features/features.2004.csv")
write.csv(as.data.frame(do.call(rbind, lapply(songs.2003[["Spotify.ID"]], getAudioFeatures) )), file="features/features.2003.csv")
write.csv(as.data.frame(do.call(rbind, lapply(songs.2002[["Spotify.ID"]], getAudioFeatures) )), file="features/features.2002.csv")
write.csv(as.data.frame(do.call(rbind, lapply(songs.2001[["Spotify.ID"]], getAudioFeatures) )), file="features/features.2001.csv")
write.csv(as.data.frame(do.call(rbind, lapply(songs.2000[["Spotify.ID"]], getAudioFeatures) )), file="features/features.2000.csv")
write.csv(as.data.frame(do.call(rbind, lapply(songs.1999[["Spotify.ID"]], getAudioFeatures) )), file="features/features.1999.csv")
write.csv(as.data.frame(do.call(rbind, lapply(songs.1998[["Spotify.ID"]], getAudioFeatures) )), file="features/features.1998.csv")
write.csv(as.data.frame(do.call(rbind, lapply(songs.1997[["Spotify.ID"]], getAudioFeatures) )), file="features/features.1997.csv")
write.csv(as.data.frame(do.call(rbind, lapply(songs.1996[["Spotify.ID"]], getAudioFeatures) )), file="features/features.1996.csv")
write.csv(as.data.frame(do.call(rbind, lapply(songs.1995[["Spotify.ID"]], getAudioFeatures) )), file="features/features.1995.csv")
write.csv(as.data.frame(do.call(rbind, lapply(songs.1994[["Spotify.ID"]], getAudioFeatures) )), file="features/features.1994.csv")
write.csv(as.data.frame(do.call(rbind, lapply(songs.1993[["Spotify.ID"]], getAudioFeatures) )), file="features/features.1993.csv")
write.csv(as.data.frame(do.call(rbind, lapply(songs.1992[["Spotify.ID"]], getAudioFeatures) )), file="features/features.1992.csv")
write.csv(as.data.frame(do.call(rbind, lapply(songs.1991[["Spotify.ID"]], getAudioFeatures) )), file="features/features.1991.csv")
write.csv(as.data.frame(do.call(rbind, lapply(songs.1990[["Spotify.ID"]], getAudioFeatures) )), file="features/features.1990.csv")
write.csv(as.data.frame(do.call(rbind, lapply(songs.1989[["Spotify.ID"]], getAudioFeatures) )), file="features/features.1989.csv")
write.csv(as.data.frame(do.call(rbind, lapply(songs.1988[["Spotify.ID"]], getAudioFeatures) )), file="features/features.1988.csv")
write.csv(as.data.frame(do.call(rbind, lapply(songs.1987[["Spotify.ID"]], getAudioFeatures) )), file="features/features.1987.csv")
write.csv(as.data.frame(do.call(rbind, lapply(songs.1986[["Spotify.ID"]], getAudioFeatures) )), file="features/features.1986.csv")
write.csv(as.data.frame(do.call(rbind, lapply(songs.1985[["Spotify.ID"]], getAudioFeatures) )), file="features/features.1985.csv")
write.csv(as.data.frame(do.call(rbind, lapply(songs.1984[["Spotify.ID"]], getAudioFeatures) )), file="features/features.1984.csv")
write.csv(as.data.frame(do.call(rbind, lapply(songs.1983[["Spotify.ID"]], getAudioFeatures) )), file="features/features.1983.csv")
write.csv(as.data.frame(do.call(rbind, lapply(songs.1982[["Spotify.ID"]], getAudioFeatures) )), file="features/features.1982.csv")
write.csv(as.data.frame(do.call(rbind, lapply(songs.1981[["Spotify.ID"]], getAudioFeatures) )), file="features/features.1981.csv")
write.csv(as.data.frame(do.call(rbind, lapply(songs.1980[["Spotify.ID"]], getAudioFeatures) )), file="features/features.1980.csv")