bd <- read.csv("/Users/marcelotam/Desktop/10. Bootcamp progra/basedatosarca.csv")
summary(bd)
## ID Año Territorio Sub.Territorio
## Min. : 1 Min. :2016 Length:466509 Length:466509
## 1st Qu.:116628 1st Qu.:2017 Class :character Class :character
## Median :233255 Median :2018 Mode :character Mode :character
## Mean :233255 Mean :2018
## 3rd Qu.:349882 3rd Qu.:2019
## Max. :466509 Max. :2019
## CEDI Cliente Nombre Tamaño.Cte.Industria
## Length:466509 Length:466509 Length:466509 Length:466509
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
## Segmento.Det Marca Presentacion Tamaño
## Length:466509 Length:466509 Length:466509 Length:466509
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
## Retornable_NR Enero Febrero Marzo
## Length:466509 Length:466509 Length:466509 Length:466509
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
## Abril Mayo Junio Julio
## Length:466509 Length:466509 Length:466509 Length:466509
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
## Agosto Septiembre Octubre Noviembre
## Length:466509 Length:466509 Length:466509 Length:466509
## Class :character Class :character Class :character Class :character
## Mode :character Mode :character Mode :character Mode :character
##
##
##
## Diciembre
## Length:466509
## Class :character
## Mode :character
##
##
##
str(bd)
## 'data.frame': 466509 obs. of 25 variables:
## $ ID : int 1 2 3 4 5 6 7 8 9 10 ...
## $ Año : int 2016 2016 2016 2016 2016 2016 2016 2016 2016 2016 ...
## $ Territorio : chr "Guadalajara" "Guadalajara" "Guadalajara" "Guadalajara" ...
## $ Sub.Territorio : chr "Belenes" "Belenes" "Belenes" "Belenes" ...
## $ CEDI : chr "Suc. Belenes" "Suc. Belenes" "Suc. Belenes" "Suc. Belenes" ...
## $ Cliente : chr "77737" "77737" "77737" "77737" ...
## $ Nombre : chr "ABARR" "ABARR" "ABARR" "ABARR" ...
## $ Tamaño.Cte.Industria: chr "Extra Grande" "Extra Grande" "Extra Grande" "Extra Grande" ...
## $ Segmento.Det : chr "Agua Mineral" "Agua Purificada" "Agua Purificada" "Agua Saborizada" ...
## $ Marca : chr "Topo Chico A.M." "Ciel Agua Purificada" "Ciel Agua Purificada" "Ciel Exprim" ...
## $ Presentacion : chr "600 ml NR" "1 Ltro. N.R." "1.5 Lts. NR" "600 ml NR" ...
## $ Tamaño : chr "Individual" "Individual" "Individual" "Individual" ...
## $ Retornable_NR : chr "No Retornable" "No Retornable" "No Retornable" "No Retornable" ...
## $ Enero : chr "" "" "" "" ...
## $ Febrero : chr "" "2" "" "" ...
## $ Marzo : chr "" "8" "3" "" ...
## $ Abril : chr "" "4" "6" "" ...
## $ Mayo : chr "" "4" "3" "" ...
## $ Junio : chr "" "2" "3" "" ...
## $ Julio : chr "" "2" "3" "" ...
## $ Agosto : chr "" "2" "3" "" ...
## $ Septiembre : chr "" "2" "3" "" ...
## $ Octubre : chr "" "2" "3" "" ...
## $ Noviembre : chr "" "4" "3" "" ...
## $ Diciembre : chr "1" "2" "3" "1" ...
# Convertir tipo de variables
bd$Cliente <- as.integer(bd$Cliente)
## Warning: NAs introduced by coercion
bd$Enero <- as.integer(bd$Enero)
## Warning: NAs introduced by coercion
bd$Febrero <- as.integer(bd$Febrero)
## Warning: NAs introduced by coercion
bd$Marzo <- as.integer(bd$Marzo)
## Warning: NAs introduced by coercion
bd$Abril <- as.integer(bd$Abril)
## Warning: NAs introduced by coercion
bd$Mayo <- as.integer(bd$Mayo)
## Warning: NAs introduced by coercion
bd$Junio <- as.integer(bd$Junio)
## Warning: NAs introduced by coercion
bd$Julio <- as.integer(bd$Julio)
## Warning: NAs introduced by coercion
bd$Agosto <- as.integer(bd$Agosto)
## Warning: NAs introduced by coercion
bd$Septiembre <- as.integer(bd$Septiembre)
## Warning: NAs introduced by coercion
bd$Octubre <- as.integer(bd$Octubre)
## Warning: NAs introduced by coercion
bd$Noviembre <- as.integer(bd$Noviembre)
## Warning: NAs introduced by coercion
bd$Diciembre <- as.integer(bd$Diciembre)
## Warning: NAs introduced by coercion
library(ggplot2)
ggplot(data = bd) +
geom_point(mapping = aes(x = ID, y = Enero))
## Warning: Removed 233552 rows containing missing values (`geom_point()`).
La gráfica muestra ventas elevadas y ventas bajas a lo largo de los ID. Encontramos que tenemos tiendas Extra Grandes que son las que reportan mayores ventas. Recomendamos analizar la base de dato por Tamaño de cliente para mejores hallazgos.