@@ -158,7 +158,7 @@ tables_rv_to_df <- function(page, tables_rv, client_timezone, database_timezone
158158
159159 if (all(class(df ) == " try-error" )) {
160160 stopApp()
161- } else if (class(df ) == " list " ) {
161+ } else if (" list " %in% class(df )) {
162162 return (df )
163163 }
164164
@@ -276,8 +276,7 @@ tables_rv_to_df <- function(page, tables_rv, client_timezone, database_timezone
276276 unnest(team_id ) %> %
277277 mutate(team_id = all_teams [[league ]]$ team_abbreviation [match(team_id , all_teams [[league ]]$ team_id )]) %> %
278278 group_by(player_id , season_name ) %> %
279- summarize(team_id = paste0(team_id , collapse = " , " )) %> %
280- ungroup()
279+ summarize(team_id = paste0(team_id , collapse = " , " ), .groups = " drop" )
281280
282281 df <- df %> %
283282 rowwise() %> %
@@ -291,8 +290,7 @@ tables_rv_to_df <- function(page, tables_rv, client_timezone, database_timezone
291290 unnest(team_id ) %> %
292291 mutate(team_id = all_teams [[league ]]$ team_abbreviation [match(team_id , all_teams [[league ]]$ team_id )]) %> %
293292 group_by(player_id ) %> %
294- summarize(team_id = paste0(team_id , collapse = " , " )) %> %
295- ungroup()
293+ summarize(team_id = paste0(team_id , collapse = " , " ), .groups = " drop" )
296294
297295 df <- df %> %
298296 mutate(team_id = player_teams $ team_id [match(player_id , player_teams $ player_id )])
@@ -320,10 +318,9 @@ tables_rv_to_df <- function(page, tables_rv, client_timezone, database_timezone
320318 }
321319
322320 if (" player_id" %in% names(df )) {
323-
324- df <- df %> %
325- mutate(player_id = player_lookup [[league ]]$ player_name [match(player_id , player_lookup [[league ]]$ player_id )])
326-
321+ df <- df | >
322+ dplyr :: mutate(player_id = player_lookup [[league ]]$ player_name [match(player_id , player_lookup [[league ]]$ player_id )]) | >
323+ dplyr :: filter(! is.na(player_id ))
327324 }
328325
329326 if (" game_id" %in% names(df )) {
0 commit comments