danmorse314 / hockeyR

Collect and Clean Hockey Stats
https://hockeyr.netlify.app/
Other
45 stars 7 forks source link

Error when loading hockeyR library from github (problem with |> pipe in files?) #1

Closed ZBetron closed 3 years ago

ZBetron commented 3 years ago

I seem to be having an issue with loading up the hockeyR library from github. The error message I am receiving is ERROR: unable to collate and parse R files for package 'hockeyR'. It then removes it from files. It also mentions an unexpected '>', which refers to a pipe |> on line 17 of fix_player_columns. After some research on the error message, it was suggested that there may be some issue when loading from a git that was using Mac, when I am using Windows. Is this an error on my end, or on the hockeyR end? Thank you so much for your help, and I am looking forward to working with hockeyR! Screenshot (287)

danmorse314 commented 3 years ago

Strange! I will have to do some digging on this. Can you tell me which version of R you have installed? My first guess is that if it's not at least 4.1 it won't recognize the native |> pipe, but I'll look into this more.

On Tue, Sep 14, 2021 at 12:20 PM Zachary Betron @.***> wrote:

I seem to be having an issue with loading up the hockeyR library from github. The error message I am receiving is ERROR: unable to collate and parse R files for package 'hockeyR'. It then removes it from files. It also mentions an unexpected '>', which refers to a pipe |> on line 17 of fix_player_columns. After some research on the error message, it was suggested that there may be some issue when loading from a git that was using Mac, when I am using Windows. Is this an error on my end, or on the hockeyR end? Thank you so much for your help, and I am looking forward to working with hockeyR! [image: Screenshot (287)] https://user-images.githubusercontent.com/82535496/133320526-5c7519b2-6dfd-4a3e-b99f-3aab819900d5.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/danmorse314/hockeyR/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKW3J3CHISAYKGJ2Z2NYW6LUB6N7NANCNFSM5EA2TRVA .

ZBetron commented 3 years ago

Just checked, and yes! The previous version of R was working with all of my previous scripts, but updating R resolved this issue I believe. Thank you for your help.

danmorse314 commented 2 years ago

blt <- stadium_df |> filter(team == "orioles")

blt |> ggplot(aes(x,y))+ geom_point( aes(group=segment) ) + geom_text( data = blt_fences, aes(y = y+5,label = round(d_wall)) )

ast <- blt |> filter( d_wall > 350 & d_wall < 377 & segment == "outfield_outer" & x < -50) |> bind_rows( filter(blt, index == 6328) ) |> arrange(x)

ast <- ast |> mutate(y = ifelse(index == 6328, y + 34, y + 28), index = ifelse(index == 6328, 6326.5, index), d_wall = sqrt(x^2 + y^2))

blt |> ggplot(aes(x,y))+ geom_point( aes(group=segment) ) + geom_point( data = ast, color = "red" )

blt_test <- blt |> filter(index %not_in% ast$index) |> bind_rows(ast) |> arrange(index)

blt_test |>

filter(segment == "outfield_fence" | segment == "outfield_outer" |

segment == "outfield_inner") |> ggplot()+ geom_path( aes(x,y,group=segment) )

blt_test |> ggplot(aes(x,y))+ geom_point( aes(group=segment) ) + geom_text( data = filter(blt_test, segment == "outfield_outer"), aes(y = y+5,label = round(d_wall)) )

outfield_inner

blt_test |> ggplot(aes(x,y)) + geom_point(aes(group = segment)) + geom_text( data = filter(blt_test, segment == "outfield_inner"), aes(label = round(x)) )

blt_track <- blt_test |> filter(x > -215.5 & x < -120 & y > 250 & segment == "outfield_inner") |> mutate( y = y + 28 )

blt_track_test <- blt_test |> filter(index %not_in% blt_track$index) |> bind_rows(blt_track) |> arrange(index)

blt_track_test |>

filter(segment == "outfield_fence" | segment == "outfield_outer" |

segment == "outfield_inner") |> ggplot()+ geom_path( aes(x,y,group=segment) )

df <- filter(stadium_df, team == "orioles") |> mutate(stadium == "Old Camden Yards") |> select(x,y,segment,stadium) |> bind_rows( blt_track_test |> mutate(stadium = "New Camden Yards") |> select(x,y,segment,stadium) )

df |> ggplot() + geom_path(aes(x,y,group=segment)) + facet_wrap(~stadium) + coord_fixed() + theme_bw() + theme(

panel.grid = element_blank(),

axis.title = element_blank(),
axis.text = element_blank(),
axis.ticks = element_blank()

)

stadium_df <- stadium_df |> filter(index %not_in% blt_track_test$index) |> bind_rows(blt_track_test)|> arrange(index)

stadium_df |> saveRDS("data/stadium_paths.rds")