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
1d33e390
Commit
1d33e390
authored
Nov 17, 2022
by
Masaki Ban
🍜
Browse files
ファイル名の修正
parent
51e2f5e2
Changes
3
Show whitespace changes
Inline
Side-by-side
R/
conver
t_spadl.R
→
R/
outpu
t_spadl.R
View file @
1d33e390
library
(
tidyverse
)
library
(
tidyverse
)
source
(
"R/read_rcg.R"
)
source
(
"R/read_rcg.R"
)
source
(
"R/read_rcl.R"
)
source
(
"R/read_rcl.R"
)
source
(
"R/rcg_covert.R"
)
source
(
"R/rcg_co
n
vert.R"
)
source
(
"R/rcl_convert.R"
)
source
(
"R/rcl_convert.R"
)
rcg
<-
read_rcg
(
"data/20220405162804-HELIOS_base_3-vs-enemy_2.rcg"
)
rcg
<-
read_rcg
(
"data/20220405162804-HELIOS_base_3-vs-enemy_2.rcg"
)
...
@@ -10,4 +10,3 @@ rcl <- read_rcl("data/20220405162804-HELIOS_base_3-vs-enemy_2.rcl")
...
@@ -10,4 +10,3 @@ rcl <- read_rcl("data/20220405162804-HELIOS_base_3-vs-enemy_2.rcl")
ball
<-
get_ball
(
rcg
)
ball
<-
get_ball
(
rcg
)
agent
<-
get_agent_pos
(
rcg
)
agent
<-
get_agent_pos
(
rcg
)
command
<-
get_command
(
rcl
)
command
<-
get_command
(
rcl
)
R/rcg_covert.R
→
R/rcg_co
n
vert.R
View file @
1d33e390
#' Read RCG file
#'
#' @param path RCG file path
#' @return Parsed tibble of RCG file in \code{path}
#' @examples
#' read_rcg("data/20220405162804-HELIOS_base_3-vs-enemy_2.rcg")
get_ball
<-
function
(
rcg
)
{
get_ball
<-
function
(
rcg
)
{
ball
<-
rcg
|>
ball
<-
rcg
|>
dplyr
::
select
(
dplyr
::
select
(
...
@@ -12,14 +5,14 @@ get_ball <- function(rcg) {
...
@@ -12,14 +5,14 @@ get_ball <- function(rcg) {
ball_x
,
ball_x
,
ball_y
,
ball_y
,
ball_vx
,
ball_vx
,
ball_vy
ball_vy
,
)
|>
)
|>
dplyr
::
distinct
(
step
,
.keep_all
=
T
)
dplyr
::
distinct
(
step
,
.keep_all
=
T
)
return
(
ball
)
return
(
ball
)
}
}
get_agent
_pos
<-
function
(
rcg
)
{
get_agent
<-
function
(
rcg
)
{
agent
_pos
<-
rcg
|>
agent
<-
rcg
|>
dplyr
::
select
(
dplyr
::
select
(
step
,
step
,
side
,
side
,
...
@@ -28,5 +21,5 @@ get_agent_pos <- function(rcg) {
...
@@ -28,5 +21,5 @@ get_agent_pos <- function(rcg) {
x
,
x
,
y
,
y
,
)
)
return
(
agent
_pos
)
return
(
agent
)
}
}
R/rcl_convert.R
View file @
1d33e390
get_kick
<-
function
(
rcl
)
{
kick
<-
rcl
|>
dplyr
::
filter
(
command
==
"kick"
)
|>
dplyr
::
select
(
step
,
team
,
unum
,
command
,
)
return
(
kick
)
}
get_command
<-
function
(
rcl
)
{
get_command
<-
function
(
rcl
)
{
kick
<-
rcl
|>
command
<-
rcl
|>
dplyr
::
filter
(
command
==
"kick"
|
command
==
"tackle"
|
command
==
"referee"
)
|>
dplyr
::
filter
(
command
==
"kick"
|
command
==
"tackle"
|
command
==
"referee"
)
|>
dplyr
::
select
(
dplyr
::
select
(
step
,
step
,
...
@@ -20,19 +8,19 @@ get_command <- function(rcl) {
...
@@ -20,19 +8,19 @@ get_command <- function(rcl) {
command
,
command
,
args
,
args
,
)
)
return
(
kick
)
return
(
command
)
}
classify_actions
<-
function
(
command
)
{
action
<-
command
|>
dplyr
::
mutate
(
)
return
(
action
)
}
}
#classify_kick <- function(kick) {
classify_pass
<-
function
(
command
)
{
# command <- kick |>
action
<-
command
|>
# dplyr::mutate(
# action <- if(kick$team)
# )
# return(command)
#}
get_tackle
<-
function
(
rcl
)
{
return
(
action
)
tackle
<-
rcl
|>
dplyr
::
filter
(
command
==
"tackle"
)
return
(
tackle
)
}
}
\ 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