Commit e81688c6 authored by numeroteca's avatar numeroteca

analiza todo abril

parent 22d3d43c
......@@ -12,13 +12,22 @@ library(tidyverse) # for ggplot
# Set search variables: words and datelimits -----
# word <- "Cifuentes|Javier Ramos|Enrique Álvarez Conde|Pablo Chico|María Teresa Feito|Alicia López de los Cobos|Cecilia Rosado|Clara Souto|Amalia Calonge|Universidad Rey Juan Carlos"
# word <- "vox|Vox|VOX|Santiago Abascal|ortega smith|francisco serrano"
# partidos y líderes
word1 <- "vox|Vox|VOX|Santiago Abascal|Abascal"
word2 <- "Podemos|Pablo Iglesias|Iglesias"
word3 <- "PP|Pablo Casado|Casado"
word4 <- "PSOE|Pedro Sánchez|Sánchez"
word5 <- "C's|Ciudadanos|Albert Rivera|Rivera"
word5 <- "C's|Cs|Ciudadanos|Albert Rivera|Rivera"
word6 <- "PACMA|Silvia Barquero|Barquero"
# partidos y líderes
word1 <- "vox|Vox"
word2 <- "vox|Vox|VOX"
word3 <- "vox|Vox|VOX|Abascal"
word4 <- "vox|Vox|VOX|Santiago Abascal|Abascal"
word5 <- "vox|Vox|VOX|Santiago Abascal|Abascal|Ortega Smith"
word6 <- "vox|Vox|VOX|Santiago Abascal|Abascal|Ortega Smith|Rocio Monasterio|Monasterio"
word <- ""
word <- data.frame(matrix(ncol = 1,nrow = 6 ))
names(word) <- c("word")
......@@ -30,7 +39,7 @@ word$word[4] <- word4
word$word[5] <- word5
word$word[6] <- word6
# Select word to be displayed in plots
# # Select word to be displayed in plots
word1_explain <- "VOX" #
word2_explain <- "Podemos" #
word3_explain <- "PP" #
......@@ -38,6 +47,14 @@ word4_explain <- "PSOE" #
word5_explain <- "Cs" #
word6_explain <- "PACMA" #
# # Select word to be displayed in plots
word1_explain <- "VOXmin" #
word2_explain <- "VOXmay" #
word3_explain <- "VOXabascal" #
word4_explain <- "VOXsantiagoabascal" #
word5_explain <- "VOXortega" #
word6_explain <- "VOXmonasterio" #
word$explain[1] <- word1_explain
word$explain[2] <- word2_explain
word$explain[3] <- word3_explain
......@@ -46,7 +63,7 @@ word$explain[5] <- word5_explain
word$explain[6] <- word6_explain
# Set time limits
my_limit <- c(as.POSIXct("2019-04-12 00:00:01"), as.POSIXct("2019-04-24 00:00:01"))
my_limit <- c(as.POSIXct("2019-04-01 00:00:01"), as.POSIXct("2019-04-26 00:12:01"))
my_init <- as.POSIXlt("2019-04-12 00:00:00")
# open compressed file
......@@ -97,7 +114,7 @@ ggplot(list[list$newspaper == "larazon", ]) +
selected <- list[(list$newspaper == "eldiario" | list$newspaper == "elconfidencial" |
list$newspaper == "elpais"| list$newspaper == "larazon" | list$newspaper == "elespanol") &
# list$date > "2018-10-01", ]
list$date > "2019-04-11", ]
list$date > "2019-03-31", ]
# Create results dataframe
results <- ""
......@@ -182,7 +199,6 @@ for (i in 1:nrow(selected)) {
results <- results %>% select(-a,-b,-c,-d,-e,-f,-aa,-bb,-cc,-dd,-ee,-ff,-aaa,-bbb,-ccc,-ddd,-eee,-fff)
# results5 <- ""
# results5 <- data.frame(matrix(ncol = 1,nrow = 5 ))
# names(results5) <- c("newspaper")
......@@ -198,7 +214,8 @@ results$date <- as.POSIXct( paste(results$year,"-",results$month,"-",results$day
# Save results
# save(results,file="data/results-vox-01.Rda")
save(results,file="data/results-vox'podemos-generales2019-b-6-partidos.Rda")
save(results,file="data/results-generales2019-6-partidos-1-25abril.Rda")
# save(results,file="data/results-vox-diferencias-busqueda.Rda")
# Load other results
# load("data/results-cifuentes-01.Rda")
......@@ -513,15 +530,15 @@ ggplot(data=results_long_n[results_long_n$newspaper=="eldiario",]) + #ylim(c(0,3
caption = "")
# para todos los periodicos -------
ggplot(data=results_long_per) +
ggplot(data=results_long_per) + #%>% filter(key== "n_selected_news_3_VOXabscal" | key== "n_selected_news_2_VOXmay") ) +
geom_line(aes(x=date, y=value, color=key),size=0.1) +
geom_smooth(aes(x=date, y=value, color=key),size=1,se = FALSE) + #,span=0.3
scale_x_datetime(date_breaks = "1 day", date_labels = "%d",
geom_smooth(aes(x=date, y=value, color=key),size=1,se = FALSE,span=0.6) + #,span=0.3
scale_x_datetime(date_breaks = "2 day", date_labels = "%d",
limits = my_limit) +
theme_minimal(base_family = "Roboto Condensed", base_size = 14) +
scale_color_manual(values=paltidos) +
labs(title = paste("Porcentaje de noticias en página de inicio"),
subtitle = "12 abril - 24 abril 2019",
labs(title = paste("% de noticias en página de inicio"),
subtitle = "1 abril - 24 abril 2019",
x = NULL,
y = NULL,
caption = "Datos: HomePageX. numeroteca.org") +
......@@ -537,15 +554,15 @@ ggplot(data=results_long_per) +
# para todos los partidos -------
ggplot(data=results_long_n) +
ggplot(data=results_long_per) +
geom_line(aes(x=date, y=value, color=newspaper),size=0.2) +
geom_smooth(aes(x=date, y=value, color=newspaper),size=1.3,se = FALSE) + #,span=0.3
scale_x_datetime(date_breaks = "1 day", date_labels = "%d",
scale_x_datetime(date_breaks = "2 day", date_labels = "%d",
limits = my_limit) +
theme_minimal(base_family = "Roboto Condensed", base_size = 14) +
scale_colour_brewer(palette = "Set2") +
labs(title = paste("Número de noticias en página de inicio"),
subtitle = "12 abril - 24 abril 2019",
labs(title = paste("% de noticias en página de inicio"),
subtitle = "1 abril - 24 abril 2019",
x = NULL,
y = NULL,
caption = "Datos: HomePageX. numeroteca.org") +
......@@ -559,7 +576,9 @@ ggplot(data=results_long_n) +
) +
facet_wrap(~key)
# medias per day
results_long_n %>%
groups_by(date)
# -------- Analysis and comparision with Pageonex.com paper front pages data ---------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment