abhiamishra / ggshakeR

An analysis and visualization R package that works with publicly available soccer data
https://abhiamishra.github.io/ggshakeR/
MIT License
112 stars 14 forks source link

Error when plotting, with white plot. #40

Closed X4ZY closed 2 years ago

X4ZY commented 2 years ago

Using the code in the tutorial in the final step i cannot get the final result because of this error: Error in if (0 <= angle & angle < 90) { : the condition has length > 1

I have little to none knowledge in R, I'm trying to learn it, could you help me? image

X4ZY commented 2 years ago

Same error happens if I try to run the plot_sonar() one. I'm on a Mac, the Plot results in a White box

image

abhiamishra commented 2 years ago

Can you copy and paste your code directly - will help us solve your issue faster

X4ZY commented 2 years ago

The code is the tutorial one, i tried it on my Windows pc and it works, but on my Mac doesn't work. The plot stays in a white box, eve in i try to export it.

library(ggshakeR)

library(worldfootballR)

single_player <- fb_player_scouting_report("https://fbref.com/en/players/f586779e/Tammy-Abraham", pos_versus = "primary")

pizza <- plot_pizza(data = single_player, type = "single", template = "forward", colour_poss = "#41ab5d", colour_att = "#fec44f", season = "Last 365 Days", colour_def = "#de2d26", theme = "dark") pizza

abhiamishra commented 2 years ago

@Ryo-N7 + @harshkrishna17 ^

harshkrishna17 commented 2 years ago

Will work on this over the weekend. There has to be a common thread between plot_pizza and plot_sonar as they both use coord_polar()

harshkrishna17 commented 2 years ago

@X4ZY could you please send an image of how the plot looks on your Mac?

X4ZY commented 2 years ago

This is the result of the plot in the preview

image

And this is how it looks if i try to export it:

Rplot

Just a white box

abhiamishra commented 2 years ago

Can you show us what happens if you click "Zoom"

I ran the code - there is no problem with the code and it should work on Mac. Maybe try to remove the package and reinstall it again

X4ZY commented 2 years ago

Maybe the problem is in my Mac, like some packages missing or something else. I tried to uninstall and reinstall both ggshake and worldfootbalR, but the result is the same one. With the zoom option the plot is always a white box, unfortunately. I think it's my problem, definitely not a code error.

SCR-20220520-pj0

harshkrishna17 commented 2 years ago

Hey @X4ZY we've pushed a commit referencing this error. Please check issue #66