This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(ggplot2) | |
library(ggtext) | |
set.seed(666) | |
# Функция для генерации случайных точек внутри треугольника | |
generate_random_points <- function(n, x_min, x_max, y_min, y_max) { | |
points <- data.frame(x = numeric(0), y = numeric(0)) | |
while (nrow(points) < n) { | |
x <- runif(1, x_min, x_max) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(jsonlite) | |
library(tidyverse) | |
library(RColorBrewer) | |
library(ggtext) | |
library(OneR) | |
#extrafont::loadfonts() # fix fonts | |
streamHistory <- | |
list.files( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 %>% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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") %>% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
NewerOlder