Commit fdcc4c80 authored by Takumi Amano's avatar Takumi Amano 💬
Browse files

[add]ゴールの判定を変更

parent 7c1b20e3
......@@ -37,6 +37,19 @@ read_goal <- function(referee, name) {
return(goal)
}
read_goal_no_judge <- function(goal) {
goal <- goal |>
dplyr::select(
step,
side,
name,
score,
)
return(goal)
}
get_player <- function(rcg, name) {
output <- rcg |>
dplyr::inner_join(name, by = "side") |>
......@@ -210,8 +223,10 @@ get_pass <- function(kick) {
output <- kick |>
dplyr::filter(pass == TRUE) %>%
distinct(step, .keep_all = TRUE) %>%
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)
dplyr::select(step,team,unum,px,py,pvx,pvy,ball_x,ball_y,ball_vx,ball_vy,next_ball_vx,next_ball_vy,pass,pass_scc) %>%
dplyr::mutate(next_ball_x = lead(ball_x)) %>%
dplyr::mutate(next_ball_y = lead(ball_y)) %>%
drop_na()
return(output)
}
......@@ -556,4 +571,61 @@ add_DynamicPressureLine_AS <- function(action_All,name){
output <- dplyr::inner_join(action_All,dpl_l,by="step") %>%
dplyr::inner_join(dpl_r,by="step",suffix = c("_l","_r"))
return(output)
}
get_movie <- function(rcl,ball,players) {
referee <- get_referee(rcl)
output <- rcl |>
dplyr::mutate(
unum = as.numeric(unum)
) |>
dplyr::select(
step,
team,
unum,
command,
) |>
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::arrange(step)
return(output)
}
get_DPL <- function(movie) {
movie <- movie %>%
filter(unum != 1)
ad <- movie %>%
dplyr::group_by(step) %>%
filter(px == max(px)) %>%
dplyr::select(
step,
AL = px
)
md <- movie %>%
dplyr::group_by(step) %>%
dplyr::summarize(ML = median(px)) %>%
dplyr::select(step, ML)
dd <- movie %>%
dplyr::group_by(step) %>%
filter(px == min(px)) %>%
dplyr::select(step, DL = px)
output <- dplyr::inner_join(ad, dd, by = "step") %>%
dplyr::inner_join(md, by = "step") %>%
distinct(step, .keep_all = TRUE)
return(output)
}
get_movie <- function(ball,players) {
output <- players |>
dplyr::inner_join(ball, by = "step") %>%
dplyr::distinct(step,team,unum, .keep_all = TRUE) %>%
dplyr::arrange(step) %>%
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)
return(output)
}
\ No newline at end of file
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