Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Error in arrange(): In argument: ..1 = stat. Caused by error: #> ! ..1 must be a vector, not a function, appearing when using plot_pizza "custom" comparison. #123

Closed
PaulinoVictor opened this issue Jul 3, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@PaulinoVictor
Copy link

PaulinoVictor commented Jul 3, 2023

What happened?


ggshakeR version: 0.2.090
R version: 2023.08.0 - daily-170

I tried to make a custom comparison graph but it was not possible due to an error, i have followed every step in the tutorial but i could not figure it out.

is there any fix to it? is it the code or the function is not working properly?

i am using the daily build of r to avoid the CacheKey error present in the 2023.06 build.

  • i had a issue with the season_player parameters but i realized it was because of the short version "Last 365 Days" that was wrongfully inputed, the name was not matching the data frame.

library(worldfootballR)
library(ggshakeR)
library(reprex)
#> Warning: package 'reprex' was built under R version 4.2.3

library(worldfootballR)
library(ggshakeR)

data1 <-fb_player_scouting_report("https://fbref.com/en/players/65159211/Yuri-Alberto", pos_versus = "primary")

data2 <- fb_player_scouting_report("https://fbref.com/en/players/2e5e846d/Deyverson", pos_versus = "primary")

data1 <- data1[c(345,338,301,377,394,386,387,402,393,395), ]

data2 <- data2[c(210,203,166,242,259,251,252,267,258,260), ]

data <- rbind(data1, data2)

graph <- plot_pizza(data = data, type = "comparison", template = "custom",
player_1 = "Deyverson", player_2 = "Yuri Alberto",
season_player_1 = "2023 Série A",
season_player_2 = "2023 Série A",
color_compare = "#c1ef01", theme = "black")
#> Error in arrange():
#> ℹ In argument: ..1 = stat.
#> Caused by error:
#> ! ..1 must be a vector, not a function.
#> Backtrace:
#> ▆
#> 1. ├─ggshakeR::plot_pizza(...)
#> 2. │ └─data1 %>% arrange(desc(stat), desc(Percentile)) %>% ...
#> 3. ├─dplyr::mutate(., Statistic = factor(Statistic, levels = Statistic))
#> 4. ├─dplyr::arrange(., desc(stat), desc(Percentile))
#> 5. ├─dplyr:::arrange.data.frame(., desc(stat), desc(Percentile))
#> 6. │ └─dplyr:::arrange_rows(.data, dots = dots, locale = .locale)
#> 7. │ ├─dplyr::mutate(data, :=("{name}", !!dot), .keep = "none")
#> 8. │ └─dplyr:::mutate.data.frame(data, :=("{name}", !!dot), .keep = "none")
#> 9. │ └─dplyr:::mutate_cols(.data, dplyr_quosures(...), by)
#> 10. │ ├─base::withCallingHandlers(...)
#> 11. │ └─dplyr:::mutate_col(dots[[i]], data, mask, new_columns)
#> 12. │ └─mask$eval_all_mutate(quo)
#> 13. │ └─dplyr (local) eval()
#> 14. ├─dplyr:::dplyr_internal_error("dplyr:::mutate_not_vector", <named list>)
#> 15. │ └─rlang::abort(class = c(class, "dplyr:::internal_error"), dplyr_error_data = data)
#> 16. │ └─rlang:::signal_abort(cnd, .file)
#> 17. │ └─base::signalCondition(cnd)
#> 18. └─dplyr (local) <fn>(<dpl:::__>)
#> 19. └─rlang::abort(message, class = error_class, parent = parent, call = error_call)

graph
#> Error in eval(expr, envir, enclos): objeto 'graph' não encontrado

ggsave("comparacao.png", bg = "black", width = 2900, height = 2800, units = "px")
#> Error in ggsave("comparacao.png", bg = "black", width = 2900, height = 2800, : não foi possível encontrar a função "ggsave"

@PaulinoVictor PaulinoVictor added the bug Something isn't working label Jul 3, 2023
@PaulinoVictor PaulinoVictor changed the title [Bug]: Error in ans[ypos] <- rep(yes, length.out = len)[ypos] when using plot_pizza. [Bug]: Error in arrange(): In argument: ..1 = stat. Caused by error: #> ! ..1 must be a vector, not a function, appearing when using plot_pizza "custom" comparison. Jul 5, 2023
@abhiamishra
Copy link
Owner

abhiamishra commented Jul 12, 2023 via email

harshkrishna17 added a commit that referenced this issue Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants