From f680c327104a68a82732313308fa238d38021450 Mon Sep 17 00:00:00 2001 From: Maxime Wack Date: Sat, 6 Jan 2018 18:36:39 +0100 Subject: [PATCH] Set numeric types beforehand --- app.R | 1 - preprocess.R | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/app.R b/app.R index c2a52eb..ca8f0d3 100644 --- a/app.R +++ b/app.R @@ -28,7 +28,6 @@ server <- function(input, output, session) imdb %>% filter(id == show_id) %>% - mutate_at(vars(season, episode, averageRating, numVotes), as.numeric) %>% by(.$season, function(x){ fit <- lm(averageRating ~ episode, data = x) x %>% diff --git a/preprocess.R b/preprocess.R index 042b3fd..bc66709 100644 --- a/preprocess.R +++ b/preprocess.R @@ -21,6 +21,7 @@ tvseries %>% inner_join(ratings, by = c("eptconst" = "tconst")) %>% inner_join(tvepisodes, by = c("eptconst" = "tconst")) %>% select(-eptconst, episodeTitle = primaryTitle) %>% + mutate_at(vars(season, episode, averageRating, numVotes), as.numeric) %>% arrange(seriesTitle, season, episode) -> final