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
Hide whitespace changes
Inline
Side-by-side
R/
conver
t_spadl.R
→
R/
outpu
t_spadl.R
View file @
1d33e390
library
(
tidyverse
)
source
(
"R/read_rcg.R"
)
source
(
"R/read_rcl.R"
)
source
(
"R/rcg_covert.R"
)
source
(
"R/rcg_co
n
vert.R"
)
source
(
"R/rcl_convert.R"
)
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")
ball
<-
get_ball
(
rcg
)
agent
<-
get_agent_pos
(
rcg
)
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
)
{
ball
<-
rcg
|>
dplyr
::
select
(
...
...
@@ -12,14 +5,14 @@ get_ball <- function(rcg) {
ball_x
,
ball_y
,
ball_vx
,
ball_vy
ball_vy
,
)
|>
dplyr
::
distinct
(
step
,
.keep_all
=
T
)
return
(
ball
)
}
get_agent
_pos
<-
function
(
rcg
)
{
agent
_pos
<-
rcg
|>
get_agent
<-
function
(
rcg
)
{
agent
<-
rcg
|>
dplyr
::
select
(
step
,
side
,
...
...
@@ -28,5 +21,5 @@ get_agent_pos <- function(rcg) {
x
,
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
)
{
kick
<-
rcl
|>
command
<-
rcl
|>
dplyr
::
filter
(
command
==
"kick"
|
command
==
"tackle"
|
command
==
"referee"
)
|>
dplyr
::
select
(
step
,
...
...
@@ -20,19 +8,19 @@ get_command <- function(rcl) {
command
,
args
,
)
return
(
kick
)
return
(
command
)
}
#classify_kick <- function(kick) {
# command <- kick |>
# dplyr::mutate(
# action <- if(kick$team)
# )
# return(command)
#}
get_tackle
<-
function
(
rcl
)
{
tackle
<-
rcl
|>
dplyr
::
filter
(
command
==
"tackle"
)
return
(
tackle
)
classify_actions
<-
function
(
command
)
{
action
<-
command
|>
dplyr
::
mutate
(
)
return
(
action
)
}
classify_pass
<-
function
(
command
)
{
action
<-
command
|>
return
(
action
)
}
\ 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