library(readxl)
library(dplyr)
library(ggplot2)
library(tidyr)
library(janitor)
library(mice)
bd1 <- data.frame(
  Red = c("Facebook", "Instagram", "Twitter", "TikTok", "Youtube"),
  Usuarios = c(27, 26, 25, 20, 28))

Gráfica No. 1

g1 <- ggplot(bd1, aes(x = Red, y = Usuarios, fill = Red)) +
  geom_bar(stat = "identity") +
  geom_text(aes(label = Usuarios), vjust = 2, colour = "white") +
  update_geom_defaults("text", list(size = 3)) +
  labs(x = "Rede social", y = "Quantidade de usuários") +
  theme_classic() +
  guides(fill = "none")
g1 + theme(text = element_text(family = "Times New Roman"))

Gráfica No. 2

bd3 <- read_excel("~/Desktop/base1.xlsx")

g2 <- ggplot(bd3, aes(x = Red, y = Usuarios, fill = Tipo)) +
  theme(text = element_text(family = "Times New Roman")) +
  geom_bar(stat = "identity") +
  geom_text(aes(label = Usuarios), colour = "white", position = position_stack(vjust = 0.5)) +
  update_geom_defaults("text", list(size = 3)) +
  labs(x = "Rede social", y = "Quantidade de usuários") +
  scale_fill_discrete(name = "Tipo de usuario") +
  theme_classic() +
  coord_flip()
g2 + theme(text = element_text(family = "Times New Roman"))

Gráfica No. 3

bd4 <- data.frame(
  Topico = c("STF", "Apoio a Bolsonaro", "Tentativa de golpe", "PT", "Lula", "Negacionismo da ciência", 
             "Perseguição às liberdades individuais", "Descrédito das instituições", "Mídia tradicional",
             "Neopentecostalização do discurso político", "Fake News", "Outros"),
  Quantidade = c(7, 11, 1, 6, 6, 5, 3, 3, 3, 1, 2, 27))

g3 <- ggplot(bd4, aes(x = Topico, y = Quantidade, fill = Topico)) +
  geom_bar(stat = "identity") +
  geom_text(aes(label = Quantidade), position = position_stack(vjust = 0.5), colour = "white") +
  update_geom_defaults("text", list(size = 3)) +
  labs(x = "Tópicos", y = "Quantidade") +
  guides(fill = "none") +
  theme_classic() +
  coord_flip()
g3 + theme(text = element_text(family = "Times New Roman"))

Gráfica No. 4

bd5 <- read_excel("~/Desktop/base2.xlsx")

g4 <- ggplot(bd5, aes(x = Usuario,y = Quantidade, fill = Tipo)) +
  geom_bar(stat = "identity", position = "dodge") +
  labs(x = "Perfil ou usuario", y = "Quantidade de publicações") +
  scale_fill_discrete(name = "Tipo de publicação", labels = c("Relacionado aos tópicos", "Total de publicações")) +
  theme_classic() +
  coord_flip()
g4 + theme(text = element_text(family = "Times New Roman"))

Gráfica No. 5

bd6 <- read_excel("~/Desktop/base3.xlsx")

g5 <- ggplot(bd6, aes(x = Topico, y = Porcentagem, fill = Rede)) +
  geom_bar(stat = "identity") +
  geom_text(aes(label = Porcentagem), colour = "white", position = position_stack(vjust = 0.5)) +
  update_geom_defaults("text", list(size = 2)) +
  labs(x = "Tópico", y = "Porcentagem") +
  scale_fill_discrete(name = "Rede social") +
  theme_classic() +
  coord_flip()
g5 + theme(text = element_text(family = "Times New Roman"))

Gráfica No. 6

bd7 <- data.frame(
  Red = c("Facebook", "Instagram", "TikTok", "Twitter", "Youtube"),
  Porcentagem = c(27.08, 12.50, 16.67, 22.92, 20.83))

g6 <- ggplot(bd7, aes(x = Red, y = Porcentagem, fill = Red)) +
  geom_bar(stat = "identity") +
  geom_text(aes(label = Porcentagem), vjust = 2, colour = "white") +
  update_geom_defaults("text", list(size = 3)) +
  labs(x = "Rede social", y = "Porcentagem") +
  guides(fill = "none") +
  theme_classic()
g6 + theme(text = element_text(family = "Times New Roman"))