Ниточки к данным, инфографике, оценкам
Автор - Андрей Гнидченко (ЦМАКП)
P. S. Рекламы нет
Post #210
875
ЗА @econbox
Showing posts older than #211 · Back to latest

















gprod <- function(url, bin=2) {
require("rvest")
require("glue")
require("ggplot2")
url <- gsub("s://","://ssl.",url)
x <- read_html(url)
tab_4 <- html_table(x, fill=TRUE)[[4]]
tab_4 <- tab_4[,c(1,ncol(tab_4))]
names(tab_4) <- c("Product","Growth")
axis_x <- tolower(tab_4$Growth[1])
tab_4 <- subset(tab_4[-c(1,2,nrow(tab_4)),], Growth!="")
tab_4$Growth <- as.numeric(gsub("\\,",".",tab_4$Growth))
tab_4 <- tab_4[!grepl("рублей", tab_4$Product), ]
tab_4 <- tab_4[grepl("^[А-Я]", tab_4$Product), ]
tab_4$Product <- gdata::trim(tab_4$Product)
shPlus <- length(tab_4$Product[tab_4$Growth>100])/
length(tab_4$Product)*100
shPlus <- round(shPlus, 0)
shMinus <- 100-shPlus
shPlus <- glue("{shPlus}%")
shMinus <- glue("{shMinus}%")
fig <- ggplot(tab_4, aes(x = Growth-100)) +
theme_minimal(base_size=16) +
geom_histogram(aes(y=after_stat(count)),
binwidth=bin, fill="lightblue") +
geom_density(aes(y=after_stat(density)*nrow(tab_4)*bin),
color="black") +
geom_vline(xintercept=0, col="red",
linetype="dashed") +
scale_y_continuous(expand=c(0.02,0), n.breaks=6) +
scale_x_continuous(n.breaks=8) +
xlab(glue("Прирост выпуска важнейших видов продукции,
{axis_x}")) +
ylab(NULL) +
annotate("text", x=c(-20,20), y=c(Inf,Inf),
label=c(shMinus, shPlus), size=6, vjust=1,
fontface='italic', family="sans",
col=c("red4","green4"), alpha=0.7)
fig
}url <- "https://rosstat.gov.ru/storage/mediabank/127_27-08-2025.html"
gprod(url, bin=2)
Our best guess is that uncertainty is not as high as indicated by the text measures, which may be distorted by the turmoil in US politics. But uncertainty is not as low as suggested by business surveys focusing on year-ahead sales. Many drivers of uncertainty are longer term or will not manifest in sales