#DELIVERABLES

#GRAPHS INFO HERE

#FINDINGS

#Spotahome e Airbnb tem o maior numero de reservas #Mountjoy tem gap entre meados de Agosto e meados de Outubro #Possui 4 meses do ano com 100% de ocupação #Marlborough tem gap entre meados de agosto e setembro #Possui 5 meses do ano com 100% de ocupação #the8mews #Possui gap em agosto e entre outubro e dezembro #Possui 3 meses do ano com 100% de ocupação #Westmoreland possui Gap entre agosto e meados de setembro # 4 meses 100% # bolton julho e meados de setembro tem gap #4 meses 100% #apartamento novo e com 2 reservas para mais de 30 dias # disponivel entre setembro e dezembro

#RECOMMENDATION

#Better work in august and september

Percentual Geral Por Plataforma

p_ocup_per_mon <- merged %>% 
  mutate(Month=factor(Month, levels = month.name)) %>%
  ggplot(mapping = aes(x=Month, y=per, fill=Platform))+
  geom_bar(position=position_fill(), stat="identity", color='#D7E1EB')+
  scale_fill_manual(values = c('#80ED99', 
                               '#57CC99',
                               '#38A3A5',
                               '#4D7298'))+
  geom_text(aes(label = sprintf("%1.2f%%", 100*merged$per)),
            colour='#16212C', fontface='bold',
            position = position_stack(vjust = 0.5), size=3.3)+
  theme_modern_rc(base_size = 10, plot_title_size = 14, 
                  base_family = 'Calibri', plot_title_face = "bold")+
  xlab('')+ylab('')+ 
  labs(title = 'Ocupação Por Plataforma')
p_ocup_per_mon 

per_plt <- merged_ %>% aggregate(dias ~ Platform, sum)
per_plt$somatotal <- sum(per_plt$dias)
per_plt$percentual <- per_plt$dias/per_plt$somatotal
per_plt
##        Platform dias somatotal percentual
## 1        Airbnb  329      1057 0.31125828
## 2        Direct  202      1057 0.19110691
## 3 HouseAnywhere   92      1057 0.08703879
## 4     Spotahome  434      1057 0.41059603

PERCENTUAL POR PLATAFORMA

p_per_plt <- per_plt %>% 
  ggplot(mapping = aes(x=Platform, y=percentual,fill=Platform))+
  geom_bar(position=position_dodge(), stat="identity", color='#D7E1EB')+
  scale_fill_manual(values = c('#80ED99', 
                               '#57CC99',
                               '#38A3A5',
                               '#4D7298'))+
  geom_text(aes(label = sprintf("%1.2f%%", 100*per_plt$percentual)),
            colour='white', fontface='bold',
            position = position_nudge(x=0,y=0.02), size=4)+
  theme_modern_rc(base_size = 10, plot_title_size = 14, 
                  base_family = 'Calibri', plot_title_face = "bold")+
  xlab('')+ylab('')+ 
  labs(title = 'Percentual Por Plataforma')
p_per_plt

#PERCENTUAL POR PROPRIEDADE POR MES

merged_property <- merge(p_ocu_geral, abc)

merged_property <- merged_property %>% 
  group_by(Platform, Month, Property) %>%
  summarise(per_p = mes/soma,.groups = 'drop')

meses <- data.frame(Month=c("March", "April", "May", "June", 
                            "July", "August", "September", "October", "November", "December"), 
                    soma=c(31,30,31,30,31,31,30,31,30,31))

#MERGE PARA GRAFICOS POR ENDEREÇO
p <- merge(p_ocu_geral, meses)
p$percent <- p$mes / p$soma

1 MOUNTJOY

mountjoy <- merged_property_MJ <- p %>% filter(str_detect(Property, 'D01 HR99')) %>%
  group_by(Month) %>%
  mutate(Month=factor(Month, levels = month.name))

ggplot(mountjoy, aes(x=Month, y=percent, fill=Platform))+
  geom_bar(position= position_dodge(), stat="identity",color='#D7E1EB')+
  scale_fill_manual(values = c('#57CC99',
                               '#38A3A5',
                               '#4D7298',
                               '#80ED99'))+
  geom_text(aes(label = sprintf("%1.2f%%", 100*mountjoy$percent)),
            colour='white', fontface='bold',
            position = position_identity(), size=4)+
  theme_modern_rc(base_size = 10, plot_title_size = 14, 
                  base_family = 'Calibri', plot_title_face = "bold")+
  xlab('')+ylab('')+ 
  labs(title = 'Ocupação Mensal Mountjoy Square')

48 MARLBOROUGH

merged_property_general <- merge(merged_property, p)

marlborough <- merged_property_general %>% filter(str_detect(Property, 'D01 KN61')) %>%
  group_by(Month) %>%
  mutate(Month=factor(Month, levels = month.name)) 


ggplot(marlborough, aes(x=Month, y=percent, fill=Platform))+
  geom_bar(position= position_dodge(), stat="identity", color='#D7E1EB')+
  scale_fill_manual(values = c('#57CC99',
                               '#38A3A5',
                               '#4D7298',
                               '#80ED99'))+
  geom_text(aes(label = sprintf("%1.2f%%", 100*marlborough$percent)),
            colour='white', fontface='bold',
            position = position_identity(), size=4)+
  theme_modern_rc(base_size = 10, plot_title_size = 14)+
  xlab('')+ylab('')+ 
  labs(title = 'Ocupação Mensal Marlborough Court')

8 MEWS

the_8mews <- merged_property_general %>% filter(str_detect(Property, 'D01 DW25')) %>%
  group_by(Month) %>%
  mutate(Month=factor(Month, levels = month.name))

ggplot(the_8mews, mapping = aes(x=Month, y=percent, fill=Platform))+
  geom_bar(position= position_dodge(), stat="identity",color='#D7E1EB')+
  scale_fill_manual(values = c('#57CC99',
                               '#38A3A5',
                               '#4D7298',
                               '#80ED99'))+
  geom_text(aes(label = sprintf("%1.2f%%", 100*the_8mews$percent)),
            colour='white', fontface='bold',
            position = position_identity(), size=4)+
  theme_modern_rc(base_size = 10, plot_title_size = 14)+
  xlab('')+ylab('')+ 
  labs(title = 'Ocupação Mensal The 8 Mews')

103 WESTMORELAND

westmoreland <- merged_property_general %>% filter(str_detect(Property, 'D04 KT95')) %>%
  group_by(Month) %>%
  mutate(Month=factor(Month, levels = month.name))

ggplot(westmoreland, mapping = aes(x=Month, y=percent, fill=Platform))+
  geom_bar(position= position_dodge(), stat="identity",color='#D7E1EB')+
  scale_fill_manual(values = c('#57CC99',
                               '#38A3A5',
                               '#4D7298',
                               '#80ED99'))+
  geom_text(aes(label = sprintf("%1.2f%%", 100*westmoreland$percent)),
            colour='white', fontface='bold',
            position = position_identity(), size=4)+
  theme_modern_rc(base_size = 10, plot_title_size = 14, 
                  base_family = 'Calibri', plot_title_face = "bold")+
  xlab('')+ylab('')+ 
  labs(title = 'Ocupação Mensal Westmoreland')

8 BOLTON

bolton<- merged_property_general %>% filter(str_detect(Property, 'D01 TN82')) %>%
  group_by(Month) %>%
  mutate(Month=factor(Month, levels = month.name))

ggplot(bolton, mapping = aes(x=Month, y=percent, fill=Platform))+
  geom_bar(position= position_dodge(), stat="identity",color='#D7E1EB')+
  scale_fill_manual(values = c('#57CC99',
                               '#38A3A5',
                               '#4D7298',
                               '#80ED99'))+
  geom_text(aes(label = sprintf("%1.2f%%", 100*bolton$percent)),
            colour='white', fontface='bold',
            position = position_identity(), size=4)+
  theme_modern_rc(base_size = 10, plot_title_size = 14, 
                  base_family = 'Calibri', plot_title_face = "bold")+
  xlab('')+ylab('')+ 
  labs(title = 'Ocupação Mensal Bolton')

4 MEWS

the_4mews <- merged_property_general %>% filter(str_detect(Property, 'D01 FV12')) %>%
  group_by(Month) %>%
  mutate(Month=factor(Month, levels = month.name))

ggplot(the_4mews, mapping = aes(x=Month, y=percent, fill=Platform))+
  geom_bar(position= position_dodge(), stat="identity",color='#D7E1EB')+
  scale_fill_manual(values = c('#57CC99',
                               '#38A3A5',
                               '#4D7298',
                               '#80ED99'))+
  geom_text(aes(label = sprintf("%1.2f%%", 100*the_4mews$percent)),
            colour='white', fontface='bold',
            position = position_identity(), size=4)+
  theme_modern_rc(base_size = 10, plot_title_size = 14, 
                  base_family = 'Calibri', plot_title_face = "bold")+
  xlab('')+ylab('')+ 
  labs(title = 'Ocupação Mensal The 4 Mews')

#Percentual Mensal Por Propriedade

p_ocu_MENSAL <- corporate %>% group_by(Month, Property) %>%
  summarise(mes=sum(Value),.groups = 'drop')

p_ocu_mensal <- merge(p_ocu_MENSAL, meses)
a <-p_ocu_mensal$mes / p_ocu_mensal$soma

p_ocu_mensal$percent <- a

p_ocu_MENSAL$per_property <- p_ocu_mensal$per_property
view(p_ocu_MENSAL)

p_ocu_MENSAL$per_property
## NULL
sprintf("%1.2f%%", 100*p_ocu_MENSAL$per_property)
## character(0)

Ocupação Mensal Por Apartamento

perc_propertie <- p_ocu_mensal %>%
  mutate(Month=factor(Month, levels = month.name)) %>%
  ggplot(aes(y=Month, x=percent, fill=Property))+
  geom_bar(position=position_fill(), stat="identity", color='#D7E1EB')+
  scale_fill_manual(values = c('#7CAB5F', 
                               '#B3D89C', 
                               '#9DC3C2',
                               '#77A6B6',
                               '#4D7298',
                               '#3C5268',
                               '#358F80',
                               '#248277',
                               '#14746F',
                               '#036666'))+
  geom_text(aes(label = sprintf("%1.2f%%", 100*p_ocu_mensal$percent)),
            colour = '#F8F6F4',
            position = position_fill(vjust = 0.5), size=2.4)+
  theme(legend.position="top")+
  theme_modern_rc(base_size = 10, plot_title_size = 14,
                  base_family = 'Calibri', plot_title_face = "bold")+
  xlab('')+ylab('')+ 
  labs(title = 'Ocupação Mensal Por Apartamento')+
  coord_flip()
perc_propertie

Total Geral de Ocupação

percentage <- data.frame(Month=c("March", "April", "May", "June", 
                                 "July", "August", "September", "October", "November", "December"),
                         properties = c(5,5,6,6,6,6,6,6,6,6))



geral <- aggregate(Value ~ Month, data=corporate, sum)
geral <- merge(geral, meses)
geral <- merge(geral, percentage)

geral$geral_percentual <- geral$Value / geral$soma / geral$properties



  
geral_graph <- geral %>%
  mutate(Month=factor(Month, levels = month.name)) %>%
  ggplot(aes(x=Month, y=geral_percentual, fill=Month))+
  geom_bar(position='dodge', stat="identity", color='#99E2B4')+
  scale_fill_manual(values = c('#99E2B4', 
                               '#88D4AB', 
                               '#78C6A3',
                               '#67B99A',
                               '#56AB91',
                               '#469D89',
                               '#358F80',
                               '#248277',
                               '#14746F',
                               '#036666'))+
  geom_text(aes(label = sprintf("%1.2f%%", 100*geral$geral_percentual)),
            colour='#e9f5db', fontface='bold',
              position = position_nudge(x=0,y=.05), size=3.3)+
  geom_hline(yintercept = mean(geral$geral_percentual), 
             linetype = "dashed", size = 1, color='#99E2B4', show.legend = TRUE)+
  annotate("text", x=.68, y=0.62, color='#99E2B4', size=2.7,
           label=sprintf("%1.2f%%", 100*mean(geral$geral_percentual)))+
  annotate("text", x=.68, y=0.565, color='#99E2B4', size=2.7,
           label='Average')+
  theme_modern_rc(base_size = 10, plot_title_size = 14)+
  xlab('')+ylab('')+ 
  labs(title = 'Ocupação Geral Mensal')
  
geral_graph