R/elbow_plot.R

Defines functions elbow_method_plot

Documented in elbow_method_plot

#' Create elbow method plot
#'
#' @param elbow_method_df
#'
#' @return ggplot object with wss and cluster relation
#' @export
#'
#' @examples
#'
#' print("exemplo")
#'
elbow_method_plot <- function(elbow_method_df){
  x <- elbow_method_df %>%
    ggplot2::ggplot(aes(x=x,y=y)) +
    ggplot2::geom_point() + ggplot2::geom_line() +
    ggplot2::geom_segment(aes(xend=max(x),
                     y=max(y),
                     x=1,yend=min(y)),linetype="dashed") +
    ggplot2::theme_bw()
  return(x)
}
moraessaur/quickds documentation built on Dec. 21, 2021, 9:04 p.m.