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

[fix]passでstepが重複するものは1つだけ残す

parent 32ba2199
...@@ -124,6 +124,7 @@ get_pass <- function(kick) { ...@@ -124,6 +124,7 @@ get_pass <- function(kick) {
dplyr::mutate(pass_scc = (a_sameteam & !a_sameunum)) %>% dplyr::mutate(pass_scc = (a_sameteam & !a_sameunum)) %>%
dplyr::mutate(pass = ((a_sameteam & !a_sameunum) | (!a_tackle_scc & !a_sameteam))) %>% dplyr::mutate(pass = ((a_sameteam & !a_sameunum) | (!a_tackle_scc & !a_sameteam))) %>%
dplyr::filter(pass) %>% dplyr::filter(pass) %>%
distinct(step,.keep_all=TRUE) %>%
select(-c(a_tackle_scc,tackle_scc, pass, a_sameteam, a_sameunum, after_team, after_unum)) select(-c(a_tackle_scc,tackle_scc, pass, a_sameteam, a_sameunum, after_team, after_unum))
return(output) return(output)
...@@ -287,7 +288,7 @@ kick_dist <- function(rcg) { ...@@ -287,7 +288,7 @@ kick_dist <- function(rcg) {
select_name <- function(data,name){ select_name <- function(data,name){
output <- data %>% output <- data %>%
dplyr::filter(team==name) dplyr::filter(team %in% name)
return(output) return(output)
} }
...@@ -297,8 +298,6 @@ get_AttackLine <- function(data){ ...@@ -297,8 +298,6 @@ get_AttackLine <- function(data){
filter(px == max(px)) %>% filter(px == max(px)) %>%
dplyr::select( dplyr::select(
step, step,
pass_team,
pass_scc,
AL=px AL=px
) )
return(output) return(output)
...@@ -322,11 +321,12 @@ get_MedianLine <- function(data){ ...@@ -322,11 +321,12 @@ get_MedianLine <- function(data){
get_DynamicPressureLine <- function(data){ get_DynamicPressureLine <- function(data){
data <- data %>% data <- data %>%
filter(unum > 1) filter(unum != 1)
ad <- get_AttackLine(data) ad <- get_AttackLine(data)
dd <- get_DefendLine(data) dd <- get_DefendLine(data)
md <- get_MedianLine(data) md <- get_MedianLine(data)
output <- dplyr::inner_join(ad,dd,by = "step") output <- dplyr::inner_join(ad,dd,by = "step") %>%
output <- dplyr::inner_join(output,md,by = "step") dplyr::inner_join(md,by = "step") %>%
distinct(step,.keep_all=TRUE)
return(output) 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