From 7ace6492e12153f180128033845cab9c372fe4cc Mon Sep 17 00:00:00 2001 From: mrcaseb Date: Mon, 1 Mar 2021 11:45:10 +0100 Subject: [PATCH] prdict.gam returned a 1D array instead of a vector --- R/aggregate_game_stats.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/aggregate_game_stats.R b/R/aggregate_game_stats.R index c6ce4d2e..80964993 100644 --- a/R/aggregate_game_stats.R +++ b/R/aggregate_game_stats.R @@ -526,7 +526,7 @@ add_dakota <- function(add_to_this, pbp, weekly) { dplyr::rename(player_id = .data$id) %>% dplyr::filter(.data$player_id %in% relevant_players) - model_data$dakota <- mgcv::predict.gam(dakota_model, model_data) + model_data$dakota <- mgcv::predict.gam(dakota_model, model_data) %>% as.vector() out <- add_to_this %>% dplyr::left_join( @@ -547,7 +547,7 @@ add_dakota <- function(add_to_this, pbp, weekly) { dplyr::rename(player_id = .data$id) %>% dplyr::filter(.data$player_id %in% relevant_players) - model_data$dakota <- mgcv::predict.gam(dakota_model, model_data) + model_data$dakota <- mgcv::predict.gam(dakota_model, model_data) %>% as.vector() out <- add_to_this %>% dplyr::left_join(