R/plot_feature.R

Defines functions plot_feature

Documented in plot_feature

#' @title Plot Feature
#'
#' @description A function that takes the original.data
#'  and plots a specific feature.
#'
#' @export


plot_feature <- function(original.data) { # nocov start
  toplot <- data.frame(
    home = original.data$possesiontime.h,
    away = original.data$possesiontime.a,
    result = original.data$res
  )

  ggplot2::ggplot(
    data = toplot,
    mapping = ggplot2::aes(
      x = home,
      y = away,
      colour = result
    )
  ) %>%
    `+`(ggplot2::geom_point())
} # nocov end
ntyndall/footballstats documentation built on Aug. 13, 2019, 1:36 p.m.