Importar la base de datos

bd <- read.csv("/Users/marcelotam/Desktop/10. Bootcamp progra/basedatosarca.csv")

Limpiar base de datos

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

Realizar las gráficas

library(ggplot2)
ggplot(data = bd) +
  geom_point(mapping = aes(x = ID, y = Enero))
## Warning: Removed 233552 rows containing missing values (`geom_point()`).

Conclusiones

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.

LS0tCnRpdGxlOiAiQWN0aXZpZGFkIEluZGl2aWR1YWwgMyIKYXV0aG9yOiAiTWFyY2VsbyBUYW0gLSBBMDE3MjIxNDAiCmRhdGU6ICIyMDIzLTAzLTIyIgpvdXRwdXQ6IAogIGh0bWxfZG9jdW1lbnQ6CiAgICB0b2M6IHRydWUKICAgIHRvY19mbG9hdDogdHJ1ZQogICAgY29kZV9kb3dubG9hZDogdHJ1ZQotLS0KCiFbXSgvVXNlcnMvbWFyY2Vsb3RhbS9EZXNrdG9wLzEwLiBCb290Y2FtcCBwcm9ncmEvZ3JhcGhzLmpwZykKCiMjIyBJbXBvcnRhciBsYSBiYXNlIGRlIGRhdG9zCmBgYHtyfQpiZCA8LSByZWFkLmNzdigiL1VzZXJzL21hcmNlbG90YW0vRGVza3RvcC8xMC4gQm9vdGNhbXAgcHJvZ3JhL2Jhc2VkYXRvc2FyY2EuY3N2Iik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