Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1
Final Year Project Appendix Connor Chaplain
2
Final Year Project Appendix Connor Chaplain
3
Final Year Project Appendix Connor Chaplain
4
Final Year Project Appendix Connor Chaplain
5
Final Year Project Appendix Connor Chaplain
6
Final Year Project Appendix Connor Chaplain
7
Final Year Project Appendix Connor Chaplain
8
Final Year Project Appendix Connor Chaplain
9
Final Year Project Appendix Connor Chaplain
+ lwd = 2)
> attach (db0717)
> hist(peak_rank,
+ breaks = 40,
+ col = “blue”,
+ xlab = “Peak Rank”, main =”Frequency of Peak Ranks 2007-
2017”)
> attach (db0906)
> hist(peak_rank,
+ breaks = 40,
+ col = “blue”,
+ xlab = “Peak Rank”, main =”Frequency of Peak Ranks 1990-
2006”)
>scatter.smooth <- (x, y = NULL, span = 2/3, degree = 1,
+ family = c(“symmetric”, “Gaussian”, xlab = NULL,
ylab = NULL,
+ ylim = range(y, prediction$y, na.rm = TRUE),
evaluation = 50, lcol=”red”, ...)
+{
+ xlabel <- if (!missing(x))
+ deparse(substitute(x))
+ ylabel <- if (!missing(y))
+ deparse(substitute(y))
+ xy <- xy.coords(x, y, xlabel, ylabel)
+ x <- xy$x
+ y <- xy$y
+ xlab <- if (is.null(xlab))
+ xy$xlab
+ else xlab
+ ylab <- if (is.null(ylab))
+ xy$ylab
+ else ylab
+ prediction <- loess.smooth(x, y, span, degree, family,
evaluation)
+ plot(x, y, ylim = ylim, xlab = “Release Date”, ylab =
“Danceability”, main = “Danceability 2007-2017” ....)
+ lines(predication, col=lcol) #
+ invisible()
+ }
> with(db0717, scatter.smooth(release_date, danceability,
col=”blue”, lcol=”green”))
>scatter.smooth <- (x, y = NULL, span = 2/3, degree = 1,
+ family = c(“symmetric”, “Gaussian”, xlab = NULL,
ylab = NULL,
+ ylim = range(y, prediction$y, na.rm = TRUE),
evaluation = 50, lcol=”red”, ...)
+{
10
Final Year Project Appendix Connor Chaplain
11
Final Year Project Appendix Connor Chaplain
12
Final Year Project Appendix Connor Chaplain
13
Final Year Project Appendix Connor Chaplain
14
Final Year Project Appendix Connor Chaplain
+ deparse(substitute(x))
+ ylabel <- if (!missing(y))
+ deparse(substitute(y))
+ xy <- xy.coords(x, y, xlabel, ylabel)
+ x <- xy$x
+ y <- xy$y
+ xlab <- if (is.null(xlab))
+ xy$xlab
+ else xlab
+ ylab <- if (is.null(ylab))
+ xy$ylab
+ else ylab
+ prediction <- loess.smooth(x, y, span, degree, family,
evaluation)
+ plot(x, y, ylim = ylim, xlab = “Release Date”, ylab =
“Speechiness”, main = “Speechiness 1993-2006” ....)
+ lines(predication, col=lcol) #
+ invisible()
+ }
> with(db9006, scatter.smooth(release_date, speechiness, col=”blue”,
lcol=”green”))
>scatter.smooth <- (x, y = NULL, span = 2/3, degree = 1,
+ family = c(“symmetric”, “Gaussian”, xlab = NULL,
ylab = NULL,
+ ylim = range(y, prediction$y, na.rm = TRUE),
evaluation = 50, lcol=”red”, ...)
+{
+ xlabel <- if (!missing(x))
+ deparse(substitute(x))
+ ylabel <- if (!missing(y))
+ deparse(substitute(y))
+ xy <- xy.coords(x, y, xlabel, ylabel)
+ x <- xy$x
+ y <- xy$y
+ xlab <- if (is.null(xlab))
+ xy$xlab
+ else xlab
+ ylab <- if (is.null(ylab))
+ xy$ylab
+ else ylab
+ prediction <- loess.smooth(x, y, span, degree, family,
evaluation)
+ plot(x, y, ylim = ylim, xlab = “Release Date”, ylab =
“Acousticness”, main = “Acousticness 2007-2017” ....)
+ lines(predication, col=lcol) #
+ invisible()
+ }
> with(db0717, scatter.smooth(release_date, acousticness,
col=”blue”, lcol=”green”))
15
Final Year Project Appendix Connor Chaplain
16
Final Year Project Appendix Connor Chaplain
17
Final Year Project Appendix Connor Chaplain
+ xy$xlab
+ else xlab
+ ylab <- if (is.null(ylab))
+ xy$ylab
+ else ylab
+ prediction <- loess.smooth(x, y, span, degree, family,
evaluation)
+ plot(x, y, ylim = ylim, xlab = “Release Date”, ylab =
“Liveness”, main = “Liveness 2007-2017” ....)
+ lines(predication, col=lcol) #
+ invisible()
+ }
> with(db0717, scatter.smooth(release_date, liveness, col=”blue”,
lcol=”green”))
>scatter.smooth <- (x, y = NULL, span = 2/3, degree = 1,
+ family = c(“symmetric”, “Gaussian”, xlab = NULL,
ylab = NULL,
+ ylim = range(y, prediction$y, na.rm = TRUE),
evaluation = 50, lcol=”red”, ...)
+{
+ xlabel <- if (!missing(x))
+ deparse(substitute(x))
+ ylabel <- if (!missing(y))
+ deparse(substitute(y))
+ xy <- xy.coords(x, y, xlabel, ylabel)
+ x <- xy$x
+ y <- xy$y
+ xlab <- if (is.null(xlab))
+ xy$xlab
+ else xlab
+ ylab <- if (is.null(ylab))
+ xy$ylab
+ else ylab
+ prediction <- loess.smooth(x, y, span, degree, family,
evaluation)
+ plot(x, y, ylim = ylim, xlab = “Release Date”, ylab =
+ lines(predication, col=lcol) #
+ invisible()
+ }
> with(db9006, scatter.smooth(release_date, liveness, col=”blue”,
lcol=”green”))
>scatter.smooth <- (x, y = NULL, span = 2/3, degree = 1,
+ family = c(“symmetric”, “Gaussian”, xlab = NULL,
ylab = NULL,
+ ylim = range(y, prediction$y, na.rm = TRUE),
evaluation = 50, lcol=”red”, ...)
18
Final Year Project Appendix Connor Chaplain
+{
+ xlabel <- if (!missing(x))
+ deparse(substitute(x))
+ ylabel <- if (!missing(y))
+ deparse(substitute(y))
+ xy <- xy.coords(x, y, xlabel, ylabel)
+ x <- xy$x
+ y <- xy$y
+ xlab <- if (is.null(xlab))
+ xy$xlab
+ else xlab
+ ylab <- if (is.null(ylab))
+ xy$ylab
+ else ylab
+ prediction <- loess.smooth(x, y, span, degree, family,
evaluation)
+ plot(x, y, ylim = ylim, xlab = “Release Date”, ylab =
“Valence”, main = “Valence 2007-2017” ....)
+ lines(predication, col=lcol) #
+ invisible()
+ }
> with(db0717, scatter.smooth(release_date, Valence, col=”blue”,
lcol=”green”))
>scatter.smooth <- (x, y = NULL, span = 2/3, degree = 1,
+ family = c(“symmetric”, “Gaussian”, xlab = NULL,
ylab = NULL,
+ ylim = range(y, prediction$y, na.rm = TRUE),
evaluation = 50, lcol=”red”, ...)
+{
+ xlabel <- if (!missing(x))
+ deparse(substitute(x))
+ ylabel <- if (!missing(y))
+ deparse(substitute(y))
+ xy <- xy.coords(x, y, xlabel, ylabel)
+ x <- xy$x
+ y <- xy$y
+ xlab <- if (is.null(xlab))
+ xy$xlab
+ else xlab
+ ylab <- if (is.null(ylab))
+ xy$ylab
+ else ylab
+ prediction <- loess.smooth(x, y, span, degree, family,
evaluation)
+ plot(x, y, ylim = ylim, xlab = “Release Date”, ylab =
“Valence”, main = “Valence 1993-2006” ....)
+ lines(predication, col=lcol) #
+ invisible()
+ }
19
Final Year Project Appendix Connor Chaplain
20
Final Year Project Appendix Connor Chaplain
21
Final Year Project Appendix Connor Chaplain
+ y <- xy$y
+ xlab <- if (is.null(xlab))
+ xy$xlab
+ else xlab
+ ylab <- if (is.null(ylab))
+ xy$ylab
+ else ylab
+ prediction <- loess.smooth(x, y, span, degree, family,
evaluation)
+ plot(x, y, ylim = ylim, xlab = “Release Date”, ylab =
“Duration (ms)”, main = “Duration 1993-2006” ....)
+ lines(predication, col=lcol) #
+ invisible()
+ }
> with(db9006, scatter.smooth(release_date, duration_ms, col=”blue”,
lcol=”green”))
22