Commit 9b41a853 authored by Takumi Amano's avatar Takumi Amano 💬
Browse files

[fix]passAllの修正

parent a202ee9e
......@@ -89,8 +89,8 @@ get_action <- function(rcl,ball,players) {
) |>
dplyr::inner_join(players, by = c("step", "team", "unum"))%>%
dplyr::inner_join(ball, by = "step") %>%
dplyr::distinct(step,team, .keep_all = TRUE) %>%
dplyr::full_join(referee,by="step") %>%
dplyr::distinct(step,team, .keep_all = TRUE) %>%
dplyr::full_join(referee,by="step") %>%
dplyr::arrange(step) %>%
dplyr::mutate(next_judge = lead(judge)) %>%
dplyr::filter(command == "kick" | command == "tackle" | command == "catch") %>%
......@@ -120,19 +120,19 @@ get_kick_log <- function(action,goal) {
output$b_sameteam[1] <- TRUE
output$b_sameunum[1] <- FALSE
output <- dplyr::full_join(output,goal,by=c("step","judge","side")) %>%
dplyr::arrange(step) %>%
dplyr::mutate(next_score = lead(score)) %>%
dplyr::mutate(next_judge = lead(judge)) %>%
dplyr::arrange(step) %>%
dplyr::mutate(next_score = lead(score)) %>%
dplyr::mutate(next_judge = lead(judge)) %>%
dplyr::mutate(is_goal = (!is.na(next_score)&(side==lead(side)))) %>%
dplyr::filter(command == "kick") %>%
dplyr::mutate(shoot_scc = (judge == "NULL") & is_goal) %>%
dplyr::mutate(shoot_scc = (judge == "NULL") & is_goal) %>%
dplyr::mutate(dribble_scc = (
(judge == "NULL") & (next_judge == "NULL") & a_sameteam & a_sameunum)) %>%
dplyr::mutate(pass_scc = (
(judge == "NULL") & (next_judge == "NULL") & a_sameteam & !a_sameunum)) %>%
dplyr::mutate(shoot = (
shoot_scc |
abs(target_ball_x) > 54 & abs(target_ball_y) < 12)) %>%
shoot_scc |
abs(target_ball_x) > 54 & abs(target_ball_y) < 12)) %>%
dplyr::mutate(dribble = (
(!shoot)&
(!dribble_scc)&
......@@ -151,7 +151,7 @@ get_kick_log <- function(action,goal) {
}
get_kick <- function(kick_log) {
output <- action %>%
output <- action %>%
dplyr::filter(command == "kick") %>%
select(-c(command, pvx, pvy, body, neck))
return(output)
......@@ -167,9 +167,10 @@ get_action_Allplayer <- function(players, action) {
get_pass_Allplayer <- function(players, pass) {
pass <- pass %>%
dplyr::select(step, px, py, pass_team = team, ball_x, ball_y, ball_vx, ball_vy, pass_scc)
dplyr::select(step,pass_team = team,ball_x,ball_y,ball_vx,ball_vy,next_ball_x,next_ball_y,next_ball_vx,next_ball_vy,pass,pass_scc)
output <- players %>%
dplyr::inner_join(pass, by = "step")
dplyr::inner_join(pass, by = "step") %>%
dplyr::distinct(step,team,unum, .keep_all = TRUE)
return(output)
}
......@@ -185,7 +186,7 @@ get_pass <- function(kick) {
output <- kick |>
dplyr::filter(pass == TRUE) %>%
distinct(step, .keep_all = TRUE) %>%
dplyr::select(step,team,numu,px,py,pvx,pvy,ball_x,ball_y,ball_vx,ball_vy,next_ball_x,next_ball_y,next_ball_vx,next_ball_vy,pass,pass_scc)
dplyr::select(step,team,unum,px,py,pvx,pvy,ball_x,ball_y,ball_vx,ball_vy,next_ball_x,next_ball_y,next_ball_vx,next_ball_vy,pass,pass_scc)
return(output)
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment