This file contains hidden or 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
# Установка и загрузка необходимых пакетов | |
if (!require(waffle)) install.packages("waffle") | |
if (!require(ggplot2)) install.packages("ggplot2") | |
if (!require(ggtext)) install.packages("ggtext") | |
if (!require(showtext)) install.packages("showtext") | |
library(waffle) | |
library(ggplot2) | |
library(ggtext) | |
library(showtext) |
This file contains hidden or 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(showtext) | |
library(ggshadow) | |
showtext_auto() | |
showtext_opts(dpi = 300) | |
font_add_google("Playfair Display", "PD") | |
font_add_google("Lato", "lato") | |
df <- read.csv( |
This file contains hidden or 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
# AI Model Benchmark Scores Across Domains | |
# https://x.com/xai/status/1891699715298730482 | |
library(tidyverse) | |
color_palette <- c( | |
"Grok-3" = "#1b9e77", | |
"Grok-3 mini" = "#66a61e", | |
"Gemini-2 Pro" = "#e7298a", | |
"DeepSeek-V3" = "#7570b3", | |
"Claude 3.5 Sonnet" = "#d95f02", |
This file contains hidden or 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
# 300.ya.ru | |
# Sys.setenv("YA_TOKEN" = "") # your token | |
get_sharing_url <- function(article_url) { | |
token <- Sys.getenv("YA_TOKEN") | |
if (is.null(token) || token == "") { | |
stop("YA_TOKEN is empty, please set the environment variable") | |
} | |
endpoint <- 'https://300.ya.ru/api/sharing-url' | |
data <- list(article_url = article_url) |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
NewerOlder