Learn R Programming

evprof (version 1.1.2)

divide_by_disconnection: Divide sessions by disconnection day

Description

Divide sessions by disconnection day

Usage

divide_by_disconnection(
  sessions,
  division_hour,
  start = getOption("evprof.start.hour")
)

Value

same sessions data set with extra column "Disconnection"

Arguments

sessions

tibble, sessions data set in evprof standard format.

division_hour

Hour to divide the groups according to disconnection time

start

integer, start hour in the x axis of the plot.

Examples

Run this code
library(dplyr)
sessions_disconnection <- california_ev_sessions %>%
  sample_frac(0.05) %>%
  divide_by_disconnection(
    start = 2, division_hour = 5
  )

# The column `Disconnection` has been added
names(sessions_disconnection)

library(ggplot2)
sessions_disconnection %>%
  tidyr::drop_na() %>%
  plot_points() +
  facet_wrap(vars(Disconnection))

Run the code above in your browser using DataLab