You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to pull player data using the ncaa_team_player_stats() function, it appears that the function is pulling player heights and handedness without a proper column to place this data. It is causing the rest of the columns pulled to be offset by two:
ncaa_team_player_stats(193,year=2024, type="batting")
2024-06-16 16:47:42.863319: Invalid arguments provided
# Player Yr Pos GP GS BA OBPct SlgPct R AB H 2B 3B TB HR RBI BB HBP SF SH K OPP DP CS Picked SB IBB GDP
1 29 AJ Gracia Fr UT 6-3 L/L 60 60 0.305 0.440 0.559 56 220 67 14 NA 123 14 58 48 7 2 1 55 3 1 1 5
2 13 Devin Obee Jr OF 6-2 R/R 60 60 0.309 0.399 0.599 57 217 67 11 2 130 16 50 29 7 5 NA 60 3 4 NA 6
3 23 Logan Bravo Sr INF 6-5 R/R 60 60 0.315 0.432 0.630 59 219 69 16 1 138 17 59 43 6 5 NA 62 3 3 NA 9
4 5 Alex Stone Sr C 6-5 R/R 60 60 0.312 0.365 0.547 45 247 77 19 NA 135 13 59 11 12 4 NA 48 9 NA NA NA
5 7 Wallace Clark Jr INF 6-0 B/R 60 60 0.285 0.451 0.446 44 186 53 11 2 83 5 42 37 24 6 5 48 3 2 1 5
Results in a column full of "NAs" meaning that manipulating the dataframe using a package like dplyr is not possible.
The text was updated successfully, but these errors were encountered:
#Determine the number of columns
num_cols <- ncol(df)
#Calculate the starting and ending indices for the columns to be shifted
start_shift <- 5 # Starting column for shifting
end_shift <- num_cols - 2 # Ending column for shifting
#Extract the incorrect column names
incorrect_names <- colnames(df)[start_shift:end_shift]
#Create a vector of shifted names (shift by 2 positions)
shifted_names <- c(tail(incorrect_names, 2), head(incorrect_names, -2))
#Rename the columns
colnames(df)[start_shift:end_shift] <- shifted_names
When attempting to pull player data using the ncaa_team_player_stats() function, it appears that the function is pulling player heights and handedness without a proper column to place this data. It is causing the rest of the columns pulled to be offset by two:
Results in a column full of "NAs" meaning that manipulating the dataframe using a package like dplyr is not possible.
The text was updated successfully, but these errors were encountered: