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(dplyr) | |
library(jmastats) | |
library(ggplot2) | |
library(ggforce) | |
# 対象地点のデータを取得 ------------------------------------------------------------- | |
# 東京 | |
df_tk <- | |
read_tide_level(.year = 2020, .month = 8, .stn = "TK") |
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
# 市区町村別得票数 | |
read_senkyo_s_shikuchouson <- function(path, sheet = 1) { | |
df_raw <- | |
readxl::read_excel(path, | |
sheet = sheet, | |
skip = 3) | |
df_raw <- | |
df_raw %>% | |
dplyr::filter(!is.na(`候補者名`)) | |
x_candidate <- |
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
#################################### | |
# 月*100+日 | |
# 9月5日 --> 905 | |
#################################### | |
library(readr) | |
library(dplyr) | |
library(ggplot2) | |
library(ggalt) | |
d <- | |
read_csv("~/Downloads/normal_phenology/nml_phenology.csv", |
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(dplyr) | |
library(readr) | |
library(ggplot2) | |
library(gggibbous) | |
library(ggtext) | |
d <- | |
read_csv("https://www.tepco.co.jp/forecast/html/images/juyo-result-j.csv", | |
skip = 2, | |
locale = locale(encoding = "cp932")) |
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
#################################### | |
# zipangu v0.2.2 | |
#################################### | |
library(zipangu) | |
library(ggplot2) | |
library(patchwork) | |
theme_set(theme_bw(base_family = suryulib::jpfont(), base_size = 6)) | |
# ベクトル化 ------------------------------------------------------------------- | |
convert_jdate(c("令和3年2月1日", "令和元年5月1日", "平31年4月1日")) |
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(jmastats) # remotes::install_gitlab("uribo/jmastats") | |
library(ggalt) | |
library(sf) | |
library(patchwork) | |
tgt_st_block_no <- c("47418", "47407", "47412", "47575", "47582", "47590", "47615", "47662", |
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(dplyr) | |
library(jmastats) | |
library(ggplot2) | |
source("https://raw.githubusercontent.com/uribo/japan-heatstroke/master/R/read_moe_wbgt.R") | |
wbgt_list1 <- | |
c(l1_lv5 = "#ff2800", | |
l1_lv4 = "#ff9600", | |
l1_lv3 = "#faf500", | |
l1_lv2 = "#a0d2ff", |
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
################################### | |
# 大都市交通センサス | |
# 第12回 首都圏 https://www.mlit.go.jp/sogoseisaku/transport/sosei_transport_tk_000007.html | |
# 線別駅間移動人員, | |
# 鉄道位置データ: 国土数値情報 鉄道時系列 https://nlftp.mlit.go.jp/ksj/gml/datalist/KsjTmplt-N05-v1_3.html | |
# 行政区画: 地球地図日本 https://www.gsi.go.jp/kankyochiri/globalmap.html | |
# 加工・編集者: 瓜生真也 (Shinya Uryu) | |
# | |
# mapboxよりアクセストークンを取得してください | |
################################### |
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(imager) | |
library(ggplot2) | |
image_to_rgbdf <- function(file) { | |
imager::load.image(file) %>% | |
as.data.frame(wide = "c") %>% | |
dplyr::mutate(rgb_val = rgb(c.1, c.2, c.3)) | |
} | |
df_plot <- |