Commit 1d33e390 authored by Masaki Ban's avatar Masaki Ban 🍜
Browse files

ファイル名の修正

parent 51e2f5e2
library(tidyverse)
source("R/read_rcg.R")
source("R/read_rcl.R")
source("R/rcg_covert.R")
source("R/rcg_convert.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)
#' 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)
}
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_actions <- function(command) {
action <- command |>
dplyr::mutate(
)
return(action)
}
#classify_kick <- function(kick) {
# command <- kick |>
# dplyr::mutate(
# action <- if(kick$team)
# )
# return(command)
#}
classify_pass <- function(command) {
action <- command |>
get_tackle <- function(rcl) {
tackle <- rcl |>
dplyr::filter(command == "tackle")
return(tackle)
return(action)
}
\ 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