library(tidyverse)
## ── Attaching packages ─────────────────────────────────────── tidyverse 1.3.1 ──
## ✓ ggplot2 3.3.5 ✓ purrr 0.3.4
## ✓ tibble 3.1.3 ✓ dplyr 1.0.7
## ✓ tidyr 1.1.3 ✓ stringr 1.4.0
## ✓ readr 2.0.0 ✓ forcats 0.5.1
## ── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
## x dplyr::filter() masks stats::filter()
## x dplyr::lag() masks stats::lag()
library(plotly)
##
## Attaching package: 'plotly'
## The following object is masked from 'package:ggplot2':
##
## last_plot
## The following object is masked from 'package:stats':
##
## filter
## The following object is masked from 'package:graphics':
##
## layout
bitacora <- read_csv("/home/frojas/Descargas/logs_2021-2018-LEPRI-54probabilidadyestadística_20210926-2329.csv",
col_names = c("fechahora","usuario","usuarioafectado","contexto","componente","nombre","descripcion","origen","IP"),skip = 1)
## Rows: 1283 Columns: 9
## ── Column specification ────────────────────────────────────────────────────────
## Delimiter: ","
## chr (9): fechahora, usuario, usuarioafectado, contexto, componente, nombre, ...
##
## ℹ Use `spec()` to retrieve the full column specification for this data.
## ℹ Specify the column types or set `show_col_types = FALSE` to quiet this message.
bitacora %>%
filter(!grepl("fernando j|administra",usuario,ignore.case = T)) %>%
mutate(usuario=str_c(str_sub(usuario,1,1),str_sub(usuario,4,4),str_sub(usuario,9,9))) %>%
rename(estudiante=usuario) %>%
plot_ly(
x=~fechahora,
y=~estudiante,
# mode="line",
type="scatter",
color=~estudiante,
showlegend=F
)
## No scatter mode specifed:
## Setting the mode to markers
## Read more about this attribute -> https://plotly.com/r/reference/#scatter-mode
## Warning in RColorBrewer::brewer.pal(N, "Set2"): n too large, allowed maximum for palette Set2 is 8
## Returning the palette you asked for with that many colors
## Warning in RColorBrewer::brewer.pal(N, "Set2"): n too large, allowed maximum for palette Set2 is 8
## Returning the palette you asked for with that many colors