Skip to content

Instantly share code, notes, and snippets.

View adisarid's full-sized avatar

Adi Sarid adisarid

View GitHub Profile
library(tidyverse)
wind_turbine <- readr::read_csv('https://raw.githubusercontent.com/rfordatascience/tidytuesday/master/data/2020/2020-10-27/wind-turbine.csv')
p1 <- ggplot(wind_turbine, aes(x = rotor_diameter_m, y = turbine_rated_capacity_k_w)) +
geom_point() +
stat_smooth(method = "lm") +
ggtitle("Capacity vs rotor diameter") +
ylab("Capacity [kW]") +
xlab("Rotor diameter [m]")
@adisarid
adisarid / app.R
Created December 4, 2020 07:57
Example for making a modal with box elements and a selectInput
library(shiny)
library(shinydashboard)
# Define UI for application that draws a histogram
ui <- dashboardPage(title = "Simple dashboard",
header = dashboardHeader(),
sidebar = dashboardSidebar(),
dashboardBody(actionButton("open_modal", "Open modal"),
textOutput("chosen_fruit"))
)
library(tidyverse)
library(patchwork)
library(glue)
tib <-
tribble(~sector, ~poor_overall, ~population_portion, ~poor_percent,
"secular", 0.27, 0.66, 0.086,
"ultra-orthodox", 0.26, 0.11, 0.52,
"arab", 0.454, 0.2, 0.47,
"others", 0.016, 0.03, 0.113) %>%
@adisarid
adisarid / bar_ilan_game2.R
Created February 10, 2024 21:56
solution to bar-ilan math riddle #2
"000"
"00O"
"0O0"
"0OO"
"O0O"
"OO0"
"OOO"
series_length <- 42