Introduccion

Column

Descripción

Datos obtenidos mediante encuesta elaborada con el objetivo de realizar este estudio

  • Edad: Representa la edad que tiene el ecuestado
  • Sexo: Representa a que genero pertenece el encuestado
  • Zona: Se refiere a si el encuestado vive en una zona Rural o Urbana
  • Veces: La cantidad de veces que el encuestado va al supermercado
  • Delivery: El encuestado conoce o no el servicio de delivery de Jumbo
  • Prime: El encuestado conoce o no el servicio de Jumbo Prime
  • Utiliza: La razon de por que el encuestado no usa el servicio
  • Dispuesto: Se refiere a si el encuestado esta dispuesto o no a usar el servicio
  • importante1 a importante 4: Nivel de importancia de 4 preguntas diferentes
  • Otros: Si el encuestado conoce o no un servicio similar
  • Info: Como se entero el encuestado de el servicio
  • Likert1 a Likert4: Afirmaciones en escala likert desde el 1 al 5
  • Ingreso: Se refiere al ingreso familiar del encuestado

Objetivo general

  • Determinar los posibles clientes que puedan ser usuarios de Jumbo Prime, como también de la utilización del servicio a domicilio mediante el canal digital de ventas.

Objetivos específicos

  • Identificar las razones por las que el cliente no hace uso del servicio de entrega a domicilio.

  • Identificar qué factores considera relevante el cliente para acceder al servicio de entrega a domicilio.

  • Identificar la preferencia del cliente entre acceder al servicio con o sin suscripción a Jumbo Prime.

Hipótesis:

  • El uso del canal de venta en línea a domicilio por parte de los clientes es menor debido a la falta de información del mismo.

Column

Resumen

Promedio General Sd General Promedio por Hombres Sd por Hombres Promedio por Mujeres Sd por Mujeres
Edad 36.505882 11.2075905 32.107143 10.2572081 38.666667 11.1023378
Veces 2.152941 1.1599044 1.892857 0.9940298 2.280702 1.2211585
Importante1 2.423529 0.9682639 2.178571 0.9048663 2.543860 0.9832558
Importante2 2.529412 1.0187321 2.464286 1.0357371 2.561403 1.0180083
Importante3 2.623529 1.0348277 2.392857 1.0659472 2.736842 1.0093547
Importante4 2.705882 1.0097563 2.678571 1.0559732 2.719298 0.9956044
Likert1 1.870588 1.2226847 1.642857 1.1292175 1.982456 1.2605445
Likert2 2.541177 1.4272263 2.285714 1.4364860 2.666667 1.4184163
Likert3 2.917647 1.6345362 2.464286 1.5511559 3.140351 1.6414127
Likert4 2.776471 1.4587704 2.321429 1.3067792 3.000000 1.4880476
Ingreso 976352.941177 681049.3427667 940357.142857 669778.7481165 994035.087719 691726.2558502

Ubicacion

Importancia

Columna 1

¿Esta dispuesta/o a suscribirse al servicio Jumbo Prime?

¿Conoce el servicio Jumbo Prime?

Columna 2

¿Qué tan importante son los beneficios extras de Jumbo Prime para usted?

¿Qué tan importante es el tiempo de entrega de Jumbo Prime para usted?

Columna 2

¿Qué tan importante son las ofertas exclusivas de Jumbo Prime para usted?

¿Qué tan importante es el precio de suscripción de Jumbo Prime?

Likert

Columna 1

Torta de Sexo

Relacion ingreso edad

Columna 1

Cuando he ido al supermercado Jumbo los empleados me invitan a usar el servicio a domicilio.

He visto en mis redes sociales publicidad respecto al servicio a domicilio de Jumbo.

Columna 2

He visto en el sitio web de Jumbo la opción de envío a domicilio.

He visto avisos publicitarios de Jumbo promoviendo el servicio a domicilio.

Graficas Pastel

Columna 1

Torta de Zona

¿Por que no utiliza el servicio de Jumbo Prime?

Columna 2

¿Conoce el servicio de delivery de Jumbo?

Frecuencia de compras al mes

Columna 3

¿Conoce otros supermercados que ofrezcan este servicio?

¿Cómo se enteró del servicio a domicilio?

Matriz de distancia

Column

Matriz Distancia

Column

Dendograma

Cluster

Columna 1

Cluster

Columna 2

Cluster Lineal

Arboles de desicion

Columna 1

¿Esta dispuesta/o a suscribirse al servicio Jumbo Prime?

Columna 2

¿Por que no utiliza el servicio de Jumbo Prime?

---
title: "Analisis de mercado, Jumbo Prime"
author: "Christopher Maulen, Diego Ibarra"
date: 05/12/2022
output: 
  flexdashboard::flex_dashboard:
    theme: flatly
    social: menu
    source_code: embed
    orientation: columns
    vertical_layout: fill
---


```{r}

library(tidyverse)
library(gridExtra)
library(readxl)
library(cluster)
library(factoextra)
library(NbClust)
library(rpart)
library(rattle) 
library(rpart.plot)
library(knitr)

```

```{r}
setwd("C:/Users/4chri/Desktop/Mercado")
df<-read_xlsx("jumbo.xlsx")
```

```{r}

#CAMBIO DE ENCABEZADOS

names(df)[2] <- "Edad"
names(df)[3] <- "Sexo"
names(df)[4] <- "Zona"
names(df)[5] <- "Veces"
names(df)[6] <- "Delivery"
names(df)[7] <- "Prime"
names(df)[8] <- "Utiliza"
names(df)[9] <- "Dispuesto"
names(df)[10] <- "Importante1"
names(df)[11] <- "Importante2"
names(df)[12] <- "Importante3"
names(df)[13] <- "Importante4"
names(df)[14] <- "Otros"
names(df)[15] <- "Info"
names(df)[16] <- "Likert1"
names(df)[17] <- "Likert2"
names(df)[18] <- "Likert3"
names(df)[19] <- "Likert4"
names(df)[20] <- "Ingreso"

```

```{r}
#DESVIACIONES Y PROMEDIO

df2<-df %>% 
  mutate(Veces = ifelse
         (Veces=="1 vez al mes",1,ifelse
          (Veces=="2 veces al mes",2 , ifelse
            (Veces=="3 veces al mes", 3, 4)))) %>% 
  mutate(Importante1 = ifelse 
         (Importante1=="Poco importante" , 1 , ifelse
           (Importante1=="Indiferente" , 2 , ifelse
             (Importante1=="Importante" , 3 , 4)))) %>% 
  mutate(Importante2 = ifelse 
         (Importante2=="Poco importante" , 1 , ifelse
           (Importante2=="Indiferente" , 2 , ifelse
             (Importante2=="Importante" , 3 , 4)))) %>% 
  mutate(Importante3 = ifelse 
         (Importante3=="Poco importante" , 1 , ifelse
           (Importante3=="Indiferente" , 2 , ifelse
             (Importante3=="Importante" , 3 , 4)))) %>% 
  mutate(Importante4 = ifelse 
         (Importante4=="Poco importante" , 1 , ifelse
           (Importante4=="Indiferente" , 2 , ifelse
             (Importante4=="Importante" , 3 , 4))))

likert<-df2 %>% 
  select(2,5,10:13,16:20)

datosg<-data.frame(map_dbl(likert,mean)) %>% 
  mutate(map_dbl(likert,sd))

names(datosg)[1]<- "Promedio General"
names(datosg)[2]<- "Sd General"

  #Hombres

likerth<-filter(df2, Sexo=="Hombre") %>% 
  select(2,5,10:13,16:20)

datosh<-data.frame(map_dbl(likerth,mean)) %>% 
  mutate(map_dbl(likerth,sd))

names(datosh)[1] <- "Promedio por Hombres"
names(datosh)[2] <- "Sd por Hombres"

  #Mujeres}

likertf<-filter(df2, Sexo=="Mujer") %>% 
  select(2,5,10:13,16:20)

datosf<-data.frame(map_dbl(likertf,mean)) %>% 
  mutate(map_dbl(likertf,sd))

names(datosf)[1] <- "Promedio por Mujeres"
names(datosf)[2] <- "Sd por Mujeres"

desviaciones <- datosg %>% 
  mutate(datosh) %>% 
  mutate(datosf)


```


```{r}

#AGRUPACION DE DATOS

df1 <- df %>% 
  mutate(Likert1 = ifelse(Likert1==1,"En desacuerdo",
                         ifelse(Likert1==2,"En desacuerdo",
                                ifelse(Likert1==3,"Indiferente","Deacuerdo")))) %>% 
  mutate(Likert2 = ifelse(Likert2==1,"En desacuerdo",
                          ifelse(Likert2==2,"En desacuerdo",
                                 ifelse(Likert2==3,"Indiferente","Deacuerdo")))) %>% 
  mutate(Likert3 = ifelse(Likert3==1,"En desacuerdo",
                          ifelse(Likert3==2,"En desacuerdo",
                                 ifelse(Likert3==3,"Indiferente","Deacuerdo")))) %>% 
  mutate(Likert4 = ifelse(Likert4==1,"En desacuerdo",
                          ifelse(Likert4==2,"En desacuerdo",
                                 ifelse(Likert4==3,"Indiferente","Deacuerdo")))) %>% 
  mutate(Ingreso = ifelse(Ingreso>2000000, "Sobre 2M",
                          ifelse(Ingreso>1200000, "Entre 1.2M y 2M",
                          ifelse(Ingreso>800000, "Entre 0.8M y 1.2M",
                          ifelse(Ingreso>400000, "Entre 0.4M y 0.8M",
                          ifelse(Ingreso>100000, "Entre 0.1M y 0,4M"))))))

```


```{r}

#LEVELS

df1$Importante1=factor(df1$Importante1, levels = c("Poco importante","Indiferente","Importante","Muy importante"))
df1$Importante2=factor(df1$Importante2, levels = c("Poco importante","Indiferente","Importante","Muy importante"))
df1$Importante3=factor(df1$Importante3, levels = c("Poco importante","Indiferente","Importante","Muy importante"))
df1$Importante4=factor(df1$Importante4, levels = c("Poco importante","Indiferente","Importante","Muy importante"))

df1$Likert1=factor(df1$Likert1, levels = c("En desacuerdo","Indiferente","Deacuerdo"))
df1$Likert2=factor(df1$Likert2, levels = c("En desacuerdo","Indiferente","Deacuerdo"))
df1$Likert3=factor(df1$Likert3, levels = c("En desacuerdo","Indiferente","Deacuerdo"))
df1$Likert4=factor(df1$Likert4, levels = c("En desacuerdo","Indiferente","Deacuerdo"))

```

```{r}

colores<- c("#00916e","#5a189a")

porcentaje_sexo<-df %>%
  group_by(Sexo) %>% 
  count() %>% 
  ungroup() %>% 
  mutate(porcentaje=`n`/sum(`n`)*100)

porcentaje_zona<-df %>%
  group_by(Zona) %>% 
  count() %>% 
  ungroup() %>% 
  mutate(porcentaje=`n`/sum(`n`)*100)

porcentaje_veces<-df %>%
  group_by(Veces) %>% 
  count() %>% 
  ungroup() %>% 
  mutate(porcentaje=`n`/sum(`n`)*100)

porcentaje_sexo<-df %>%
  group_by(Sexo) %>% 
  count() %>% 
  ungroup() %>% 
  mutate(porcentaje=`n`/sum(`n`)*100)

porcentaje_delivery<-df %>%
  group_by(Delivery) %>% 
  count() %>% 
  ungroup() %>% 
  mutate(porcentaje=`n`/sum(`n`)*100)

porcentaje_prime<-df %>%
  group_by(Prime) %>% 
  count() %>% 
  ungroup() %>% 
  mutate(porcentaje=`n`/sum(`n`)*100)

porcentaje_utiliza<-df %>%
  group_by(Utiliza) %>% 
  count() %>% 
  ungroup() %>% 
  mutate(porcentaje=`n`/sum(`n`)*100)

porcentaje_dispuesto<-df %>%
  group_by(Dispuesto) %>% 
  count() %>% 
  ungroup() %>% 
  mutate(porcentaje=`n`/sum(`n`)*100)

porcentaje_otros<-df %>%
  group_by(Otros) %>% 
  count() %>% 
  ungroup() %>% 
  mutate(porcentaje=`n`/sum(`n`)*100)

porcentaje_info<-df %>%
  group_by(Info) %>% 
  count() %>% 
  ungroup() %>% 
  mutate(porcentaje=`n`/sum(`n`)*100)

```



```{r}

#ANALISIS CLUSTER

df3 <- df1 %>% 
  select(c(3,5,8,10:13,15:20)) %>% 
  mutate(Sexo = ifelse (Sexo=="Hombre" , 1 , 2)) %>% 
  mutate(Veces = ifelse
         (Veces=="1 vez al mes" , 1 , ifelse
          (Veces=="2 veces al mes", 2, ifelse
            (Veces=="3 veces al mes", 3, 4)))) %>% 
  mutate(Utiliza = ifelse
         (Utiliza=="No lo necesito" , 1 , ifelse
           (Utiliza=="Por el costo del servicio", 2, ifelse
             (Utiliza=="Falta de información", 3, ifelse
               (Utiliza=="Porque no accede a zona rural", 4, 5))))) %>% 
  mutate(Importante1 = ifelse 
         (Importante1=="Poco importante" , 1 , ifelse
           (Importante1=="Indiferente" , 2 , ifelse
             (Importante1=="Importante" , 3 , 4)))) %>% 
  mutate(Importante2 = ifelse 
         (Importante2=="Poco importante" , 1 , ifelse
           (Importante2=="Indiferente" , 2 , ifelse
             (Importante2=="Importante" , 3 , 4)))) %>% 
  mutate(Importante3 = ifelse 
         (Importante3=="Poco importante" , 1 , ifelse
           (Importante3=="Indiferente" , 2 , ifelse
             (Importante3=="Importante" , 3 , 4)))) %>% 
  mutate(Importante4 = ifelse 
         (Importante4=="Poco importante" , 1 , ifelse
           (Importante4=="Indiferente" , 2 , ifelse
             (Importante4=="Importante" , 3 , 4)))) %>% 
  mutate(Info = ifelse
         (Info=="Recomendación de un conocido" , 1 , ifelse
           (Info=="Avisos publicitarios (televisión, radio, etc)", 2, ifelse
             (Info=="Sitio web de Jumbo", 3, ifelse
               (Info=="Redes sociales", 4, 5))))) %>% 
  mutate(Likert1 = ifelse 
         (Likert1=="En desacuerdo" , 1 , ifelse
           (Importante1=="Indiferente" , 2 , 3))) %>% 
  mutate(Likert2 = ifelse 
         (Likert2=="En desacuerdo" , 1 , ifelse
           (Likert2=="Indiferente" , 2 , 3))) %>% 
  mutate(Likert3 = ifelse 
         (Likert3=="En desacuerdo" , 1 , ifelse
           (Likert3=="Indiferente" , 2 , 3))) %>% 
  mutate(Likert4 = ifelse 
         (Likert4=="En desacuerdo" , 1 , ifelse
           (Likert4=="Indiferente" , 2 , 3))) %>% 
  mutate(Ingreso = ifelse 
         (Ingreso=="Entre 0.1M y 0,4M" , 1 , ifelse
           (Ingreso=="Entre 0.4M y 0.8M" , 2 , ifelse
             (Ingreso=="Entre 0.8M y 1.2M", 3 , ifelse
               (Ingreso=="Entre 1.2M y 2M", 4 , 5 )))))
  

#NORMALIZANDO VALORES DE VARIABLES
df3 <- scale(df3)

#ASIGNAMOS VALOR PROMEDIO A LOS NA
df3[is.na(df3)]=0

#ASIGNANDO MATRIZ DE DISTANCIA ATRAVES DEL MÉTODO EUCLIDIANO
matriz_distancia <- get_dist(df3, method = "euclidean")

#EN FUNCION DE LA REGLA DE LA MAYORÍA, EL NUMERO DE CLUSTERS A UTILIZAR SERÁ DE 4
k4 <- kmeans(df3, centers = 2, nstart = 25)

#OTRA FORMA GRAFICA
resultado_cluster_3 <- hcut(df3, k = 2, stand = TRUE)

#PASAR LOS CLUSTERS AL DF INICIAL
df4<-as.data.frame(df3)
names(df4)[1] <- "Sex"
names(df4)[2] <- "Veces"
names(df4)[3] <- "Utiliza"
names(df4)[4] <- "Imp1"
names(df4)[5] <- "Imp2"
names(df4)[6] <- "Imp3"
names(df4)[7] <- "Imp4"
names(df4)[8] <- "Info"
names(df4)[9] <- "Lik1"
names(df4)[10] <- "Lik2"
names(df4)[11] <- "Lik3"
names(df4)[12] <- "Lik4"
df4$cluster<-as.factor(k4$cluster)
df4$cluster<-factor(df4$cluster)

df4_long<-gather(df4, pregunta, Valor, Sex:Lik4, factor_key = TRUE)

```

```{r}

#ARBOLES DE DESICION

dispuesto <- rpart(
  formula = Dispuesto ~ Sexo + Edad + Zona + Ingreso,
  data = df1,
  method = 'class'
)

utiliza <- rpart(
  formula = Utiliza ~ Sexo + Edad + Zona + Ingreso,
  data = df1,
  method = 'class'
)

```

**Introduccion**
=======================================================================

Column {data-width=400}
-----------------------------------------------------------------------

![](jumbo.png){height=350px}


### **Descripción**

**Datos obtenidos mediante encuesta elaborada con el objetivo de realizar este estudio**

- **Edad**: Representa la edad que tiene el ecuestado
- **Sexo**: Representa a que genero pertenece el encuestado
- **Zona**: Se refiere a si el encuestado vive en una zona Rural o Urbana
- **Veces**: La cantidad de veces que el encuestado va al supermercado
- **Delivery**: El encuestado conoce o no el servicio de delivery de Jumbo
- **Prime**: El encuestado conoce o no el servicio de Jumbo Prime
- **Utiliza**: La razon de por que el encuestado no usa el servicio
- **Dispuesto**: Se refiere a si el encuestado esta dispuesto o no a usar el servicio
- **importante1 a importante 4**: Nivel de importancia de 4 preguntas diferentes
- **Otros**: Si el encuestado conoce o no un servicio similar
- **Info**: Como se entero el encuestado de el servicio
- **Likert1 a Likert4**: Afirmaciones en escala likert desde el 1 al 5
- **Ingreso**: Se refiere al ingreso familiar del encuestado

**Objetivo general**

- Determinar los posibles clientes que puedan ser usuarios de Jumbo Prime, como también de la utilización del servicio a domicilio mediante el canal digital de ventas.

**Objetivos específicos**

- Identificar las razones por las que el cliente no hace uso del servicio de entrega a domicilio.

- Identificar qué factores considera relevante el cliente para acceder al servicio de entrega a domicilio.

- Identificar la preferencia del cliente entre acceder al servicio con o sin suscripción a Jumbo Prime.

**Hipótesis:**

- El uso del canal de venta en línea a domicilio por parte de los clientes es menor debido a la falta de información del mismo.


Column {data-width=600}
-----------------------------------------------------------------------


### **Resumen**

```{r}
options(scipen=999)
kable(desviaciones) 
  
```


### **Ubicacion**

```{r} 

library(leaflet) 
leaflet() %>% 
  setView(-70.30738,-18.46877, zoom = 17) %>% 
  addTiles() %>% 
  addMarkers(-70.30738,-18.46877, popup = "Jumbo") 

``` 


# ***Importancia***

## Columna 1

### ***¿Esta dispuesta/o a suscribirse al servicio Jumbo Prime?***

```{r}

ggplot(porcentaje_dispuesto,aes(1,porcentaje,fill=Dispuesto))+
  geom_bar(stat = "identity")+
  geom_text(aes(label = paste0(round(porcentaje,1),"%")),
            position = position_stack(vjust = .5))+
  coord_polar(theta = "y")+
  theme_void()+
  ggtitle("")+
  theme(plot.title=element_text(hjust=0.5))+
  scale_fill_brewer(palette="Greens")

```

### ***¿Conoce el servicio Jumbo Prime?***

```{r}

ggplot(porcentaje_prime,aes(1,porcentaje,fill=Prime))+
  geom_bar(stat = "identity")+
  geom_text(aes(label = paste0(round(porcentaje,1),"%")),
            position = position_stack(vjust = .5))+
  coord_polar(theta = "y")+
  theme_void()+
  ggtitle("")+
  theme(plot.title=element_text(hjust=0.5))+
  scale_fill_brewer(palette="Greens")

```

## Columna 2

### ***¿Qué tan importante son los beneficios extras de Jumbo Prime para usted?***

```{r}

df1 %>% 
  ggplot(aes(Importante1))+
  geom_bar(aes(fill=Dispuesto),position = "dodge",show.legend = TRUE)+
  geom_bar(alpha=1/3)+
  geom_text(stat='count', aes(label=..count..), vjust=-1)+
  theme_minimal()+  xlab("")+
  ylab("")+
  ggtitle("")+
  theme(plot.title=element_text(hjust=0.5))+
  scale_fill_brewer(palette="Greens")

```

### ***¿Qué tan importante es el tiempo de entrega de Jumbo Prime para usted?***

```{r}

df1 %>% 
  ggplot(aes(Importante2))+
  geom_bar(aes(fill=Dispuesto),position = "dodge",show.legend = TRUE)+
  geom_bar(alpha=1/3)+
  geom_text(stat='count', aes(label=..count..), vjust=-1)+
  theme_minimal()+  xlab("")+
  ylab("")+
  ggtitle("")+
  theme(plot.title=element_text(hjust=0.5))+
  scale_fill_brewer(palette="Greens")

```

## Columna 2

### ***¿Qué tan importante son las ofertas exclusivas de Jumbo Prime para usted?***

```{r}

df1 %>% 
  ggplot(aes(Importante3))+
  geom_bar(aes(fill=Dispuesto),position = "dodge",show.legend = TRUE)+
  geom_bar(alpha=1/3)+
  geom_text(stat='count', aes(label=..count..), vjust=-1)+
  theme_minimal()+  xlab("")+
  ylab("")+
  ggtitle("")+
  theme(plot.title=element_text(hjust=0.5))+
  scale_fill_brewer(palette="Greens")

```

### ***¿Qué tan importante es el precio de suscripción de Jumbo Prime?***

```{r}

df1 %>% 
  ggplot(aes(Importante4))+
  geom_bar(aes(fill=Dispuesto),position = "dodge",show.legend = TRUE)+
  geom_bar(alpha=1/3)+
  geom_text(stat='count', aes(label=..count..), vjust=-1)+
  theme_minimal()+  xlab("")+
  ylab("")+
  ggtitle("")+
  theme(plot.title=element_text(hjust=0.5))+
  scale_fill_brewer(palette="Greens")

```

# ***Likert***

## Columna 1

### ***Torta de Sexo***

```{r}

ggplot(porcentaje_sexo,aes(1,porcentaje,fill=Sexo))+
  geom_bar(stat = "identity")+
  geom_text(aes(label = paste0(round(porcentaje,1),"%")),
            position = position_stack(vjust = .5))+
  coord_polar(theta = "y")+
  theme_void()+
  ggtitle("")+
  theme(plot.title=element_text(hjust=0.5))+
  scale_fill_brewer(palette="Greens")

```

### ***Relacion ingreso edad***

```{r}
options(scipen=999)


df %>% 
  filter(df$Ingreso<2500000) %>% 
ggplot(aes(x=Edad,y=Ingreso))+
  geom_point(mapping=aes(color=Sexo),show.legend = TRUE)+
  geom_smooth(se=FALSE,color="green")+
  ggtitle("")+
  ylab("")+
  xlab("")+
  theme_minimal()+
  scale_color_manual(values = colores)

```

## Columna 1

### ***Cuando he ido al supermercado Jumbo los empleados me invitan a usar el servicio a domicilio.***

```{r}

df1 %>% 
  ggplot(aes(Likert1))+
  geom_bar(aes(fill=Sexo),position = "dodge",show.legend = TRUE)+
  geom_bar(alpha=1/3)+
  geom_text(stat='count', aes(label=..count..), vjust=-1)+
  theme_minimal()+  xlab("")+
  ylab("")+
  ggtitle("")+
  theme(plot.title=element_text(hjust=0.5))+
  scale_fill_brewer(palette="Greens")

```

### ***He visto en mis redes sociales publicidad respecto al servicio a domicilio de Jumbo.***

```{r}

df1 %>% 
  ggplot(aes(Likert2))+
  geom_bar(aes(fill=Sexo),position = "dodge",show.legend = TRUE)+
  geom_bar(alpha=1/3)+
  geom_text(stat='count', aes(label=..count..), vjust=-1)+
  theme_minimal()+  xlab("")+
  ylab("")+
  ggtitle("")+
  theme(plot.title=element_text(hjust=0.5))+
  scale_fill_brewer(palette="Greens")

```

## Columna 2

### ***He visto en el sitio web de Jumbo la opción de envío a domicilio.***

```{r}

df1 %>% 
  ggplot(aes(Likert3))+
  geom_bar(aes(fill=Sexo),position = "dodge",show.legend = TRUE)+
  geom_bar(alpha=1/3)+
  geom_text(stat='count', aes(label=..count..), vjust=-1)+
  theme_minimal()+  xlab("")+
  ylab("")+
  ggtitle("")+
  theme(plot.title=element_text(hjust=0.5))+
  scale_fill_brewer(palette="Greens")

```

### ***He visto avisos publicitarios de Jumbo promoviendo el servicio a domicilio.***

```{r}

df1 %>% 
  ggplot(aes(Likert4))+
  geom_bar(aes(fill=Sexo),position = "dodge",show.legend = TRUE)+
  geom_bar(alpha=1/3)+
  geom_text(stat='count', aes(label=..count..), vjust=-1)+
  theme_minimal()+  xlab("")+
  ylab("")+
  ggtitle("")+
  theme(plot.title=element_text(hjust=0.5))+
  scale_fill_brewer(palette="Greens")

```


# ***Graficas Pastel***

## Columna 1


### ***Torta de Zona***

```{r}

ggplot(porcentaje_zona,aes(1,porcentaje,fill=Zona))+
  geom_bar(stat = "identity")+
  geom_text(aes(label = paste0(round(porcentaje,1),"%")),
            position = position_stack(vjust = .5))+
  coord_polar(theta = "y")+
  theme_void()+
  ggtitle("")+
  theme(plot.title=element_text(hjust=0.5))+
  scale_fill_brewer(palette="Greens")

```

### ***¿Por que no utiliza el servicio de Jumbo Prime?***

```{r}

ggplot(porcentaje_utiliza,aes(1,porcentaje,fill=Utiliza))+
  geom_bar(stat = "identity")+
  geom_text(aes(label = paste0(round(porcentaje,1),"%")),
            position = position_stack(vjust = .5))+
  coord_polar(theta = "y")+
  theme_void()+
  ggtitle("")+
  theme(plot.title=element_text(hjust=0.5))+
  scale_fill_brewer(palette="Greens")

```


## Columna 2

### ***¿Conoce el servicio de delivery de Jumbo?***

```{r}

ggplot(porcentaje_delivery,aes(1,porcentaje,fill=Delivery))+
  geom_bar(stat = "identity")+
  geom_text(aes(label = paste0(round(porcentaje,1),"%")),
            position = position_stack(vjust = .5))+
  coord_polar(theta = "y")+
  theme_void()+
  ggtitle("")+
  theme(plot.title=element_text(hjust=0.5))+
  scale_fill_brewer(palette="Greens")

```


### ***Frecuencia de compras al mes***

```{r}

ggplot(porcentaje_veces,aes(1,porcentaje,fill=Veces))+
  geom_bar(stat = "identity")+
  geom_text(aes(label = paste0(round(porcentaje,1),"%")),
            position = position_stack(vjust = .5))+
  coord_polar(theta = "y")+
  theme_void()+
  ggtitle("")+
  theme(plot.title=element_text(hjust=0.5))+
  scale_fill_brewer(palette="Greens")

```

## Columna 3

### ***¿Conoce otros supermercados que ofrezcan este servicio?***

```{r}

ggplot(porcentaje_otros,aes(1,porcentaje,fill=Otros))+
  geom_bar(stat = "identity")+
  geom_text(aes(label = paste0(round(porcentaje,1),"%")),
            position = position_stack(vjust = .5))+
  coord_polar(theta = "y")+
  theme_void()+
  ggtitle("")+
  theme(plot.title=element_text(hjust=0.5))+
  scale_fill_brewer(palette="Greens")

```

### ***¿Cómo se enteró del servicio a domicilio?***

```{r}

ggplot(porcentaje_info,aes(1,porcentaje,fill=Info))+
  geom_bar(stat = "identity")+
  geom_text(aes(label = paste0(round(porcentaje,1),"%")),
            position = position_stack(vjust = .5))+
  coord_polar(theta = "y")+
  theme_void()+
  ggtitle("")+
  theme(plot.title=element_text(hjust=0.5))+
  scale_fill_brewer(palette="Greens")

```

**Matriz de distancia** 
=======================================================================

Column {data-width=450}
-----------------------------------------------------------------------

### ***Matriz Distancia***

```{r}

fviz_dist(matriz_distancia, gradient = list(low = "#00916e", mid = "#EDF8E9", high = "#5a189a"))

```


Column {data-width=550} 
-----------------------------------------------------------------------

### ***Dendograma***

```{r}

fviz_dend(resultado_cluster_3, rect = TRUE, cex = 0.5,
          k_colors = c("#00916e","#5a189a","#238B45","black"))+
  ggtitle("")

```



# ***Cluster***

## Columna 1

### ***Cluster***

```{r}

fviz_cluster(k4, data = df3, ellipse.type = "norm", pallete = "Set2", ggtheme = theme_minimal())+
  ggtitle("")
  

```

## Columna 2

### ***Cluster Lineal***

```{r}


ggplot(df4_long, aes(as.factor(x=pregunta), y=Valor, group=cluster, colour=cluster))+
  stat_summary(fun = mean, geom="pointrange", size=1)+
  stat_summary(geom="line")+
  geom_point(aes(shape=cluster))+
  xlab("")+
  ylab("")+
  theme_minimal()+
  ggtitle("")+
  scale_color_manual(values = colores)

```

# ***Arboles de desicion***

## Columna 1

### ***¿Esta dispuesta/o a suscribirse al servicio Jumbo Prime?***

```{r}

fancyRpartPlot(dispuesto)

```

## Columna 2

### ***¿Por que no utiliza el servicio de Jumbo Prime?***

```{r}

fancyRpartPlot(utiliza)

```