Skip to content

Instantly share code, notes, and snippets.

View tukachev's full-sized avatar

Yurij Tukachev tukachev

View GitHub Profile
library(httr)
library(jsonlite)
library(dplyr)
library(ggplot2)
# Download full database
astronaut_db_url <-
'https://supercluster-iadb.s3.us-east-2.amazonaws.com/adb.json'
astronauts_db <-
jsonlite::fromJSON(content(GET(astronaut_db_url), "text"))
library(jsonlite)
library(tidyverse)
library(RColorBrewer)
library(ggtext)
library(OneR)
#extrafont::loadfonts() # fix fonts
streamHistory <-
list.files(
@tukachev
tukachev / ru_tiled_map.R
Created July 24, 2018 17:33
Плиточная карта РФ
library(geofacet)
library(ggplot2)
mygrid <- data.frame(
row = c(1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8,
8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11),
col = c(1, 5, 18, 19, 4, 10, 1, 12, 17, 18, 3, 4, 5, 9, 10, 15, 12, 13, 8, 9,
10, 17, 18, 20, 1, 3, 14, 15, 16, 4, 5, 6, 7, 12, 13, 7, 8, 9, 10, 17,
14, 15, 16, 3, 4, 5, 6, 12, 7, 8, 9, 10, 18, 13, 14, 15, 16, 3, 4, 5,
library(tidyverse)
library(ggdark)
astronauts <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-07-14/astronauts.csv')
astronauts <- astronauts %>%
mutate(age_at_selection = year_of_selection - year_of_birth,
age_at_mission = year_of_mission - year_of_birth)
astronauts %>%
library(tidyverse)
library(readr)
library(ggtext)
battery_log <- read_csv("battery_log.csv",
col_names = FALSE,
locale = locale(encoding = "ASCII"))
# View(battery_log)
battery_log <- battery_log %>% rename(
library(tidyverse)
library(lubridate)
birthdate <- ymd("1978-06-28")
# Вычисление количества прожитых полных лет и недель
age_years <-
floor(as.numeric(difftime(Sys.Date(), birthdate, units = "days")) / 365.25)
age_in_weeks <- age_years * 52
library(jsonlite)
library(stringr)
library(tidyverse)
library(wordcloud)
# Загружаем данные из JSON-файла
data <- fromJSON("result.json")
# str(data$messages$text[10])
library(tidyverse)
# remotes::install_github(c("ropensci/tabulizerjars", "ropensci/tabulizer"), INSTALL_opts = "--no-multiarch")
library(tabulizer)
library(rvest)
library(googlesheets4)
url <- "https://minjust.gov.ru/ru/activity/directions/942/"
links <- read_html(url) %>%
html_elements("#section-description > div a") %>%
pacman::p_load(ggbump, tidyverse, cowplot, wesanderson, ggrepel)
df <- tibble(
region = c(rep("Магнитогорск", 5),
c(rep("Челябинск", 5)),
c(rep("Нижний Тагил", 5))),
year = c(
2017,
2018,
2019,
2020,
@tukachev
tukachev / fedbud.R
Created October 5, 2022 07:18
Доля нефтегазовых доходов в федеральном бюджете России по годам
library(tidyverse)
# library(readxl)
library(scales)
library(openxlsx)
# fedbud <- read_excel("fedbud_month.xlsx",
# sheet = "месяц", skip = 2)
url <-
"https://minfin.gov.ru/common/upload/library/2022/08/main/fedbud_month.xlsx"