Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Keisuke ANDO
socceR
Commits
d5600352
Commit
d5600352
authored
Oct 27, 2022
by
Takumi Amano
💬
Browse files
[fix]passでstepが重複するものは1つだけ残す
parent
32ba2199
Changes
1
Show whitespace changes
Inline
Side-by-side
R/make_data.R
View file @
d5600352
...
...
@@ -124,6 +124,7 @@ get_pass <- function(kick) {
dplyr
::
mutate
(
pass_scc
=
(
a_sameteam
&
!
a_sameunum
))
%>%
dplyr
::
mutate
(
pass
=
((
a_sameteam
&
!
a_sameunum
)
|
(
!
a_tackle_scc
&
!
a_sameteam
)))
%>%
dplyr
::
filter
(
pass
)
%>%
distinct
(
step
,
.keep_all
=
TRUE
)
%>%
select
(
-
c
(
a_tackle_scc
,
tackle_scc
,
pass
,
a_sameteam
,
a_sameunum
,
after_team
,
after_unum
))
return
(
output
)
...
...
@@ -287,7 +288,7 @@ kick_dist <- function(rcg) {
select_name
<-
function
(
data
,
name
){
output
<-
data
%>%
dplyr
::
filter
(
team
==
name
)
dplyr
::
filter
(
team
%in%
name
)
return
(
output
)
}
...
...
@@ -297,8 +298,6 @@ get_AttackLine <- function(data){
filter
(
px
==
max
(
px
))
%>%
dplyr
::
select
(
step
,
pass_team
,
pass_scc
,
AL
=
px
)
return
(
output
)
...
...
@@ -322,11 +321,12 @@ get_MedianLine <- function(data){
get_DynamicPressureLine
<-
function
(
data
){
data
<-
data
%>%
filter
(
unum
>
1
)
filter
(
unum
!=
1
)
ad
<-
get_AttackLine
(
data
)
dd
<-
get_DefendLine
(
data
)
md
<-
get_MedianLine
(
data
)
output
<-
dplyr
::
inner_join
(
ad
,
dd
,
by
=
"step"
)
output
<-
dplyr
::
inner_join
(
output
,
md
,
by
=
"step"
)
output
<-
dplyr
::
inner_join
(
ad
,
dd
,
by
=
"step"
)
%>%
dplyr
::
inner_join
(
md
,
by
=
"step"
)
%>%
distinct
(
step
,
.keep_all
=
TRUE
)
return
(
output
)
}
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment