Skip to content

Instantly share code, notes, and snippets.

View uribo's full-sized avatar
🍉
fine

Shinya Uryu uribo

🍉
fine
View GitHub Profile
@uribo
uribo / shikoku_map.R
Created June 6, 2024 08:24
四国、徳島県をハイライトさせる地図
library(dplyr)
library(sf)
d <-
fs::dir_ls("~/Documents/resources/国土数値情報/N03/2024/",
regexp = "(36|37|38|39).geojson$",
recurse = TRUE) |>
purrr::set_names(c(zipangu::jpnprefs |>
filter(jis_code %in% as.character(c(36, 37, 38, 39))) |>
pull(prefecture_kanji))) |>
{
"schemaVersion": 1,
"label": "徳島大学附属図書館",
"message": "蔵書あり",
"color": "green"
}
[{"lib":"Univ_Tokushima","reserveurl":"","libkey":"蔵書なし"},{"lib":"Tokushima_Tokushima","reserveurl":"https://opac.lib.tokushima-u.ac.jp/opac/volume/1382750","libkey":"蔵書あり"},{"lib":"Tokushima_Pref","reserveurl":"","libkey":"蔵書なし"}]
library(httr2)
library(rvest)
# ページリスト ------------------------------------------------------------------
req <-
request("https://scrapbox.io/") |>
req_url_path_append("api/pages/") |>
req_url_path_append("mandaRa")
x <-
req |>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@uribo
uribo / estat_toukei_00500215.R
Created February 23, 2023 07:53
作物統計調査のデータをダウンロードして綺麗な形でRに読み込む
##############################
# 作物統計調査のデータをダウンロードして綺麗な形でRに読み込む
# 表分類: 品目別結果樹面積、収穫量及び出荷量累年統計(昭和48年~)
##############################
# 1. 対象のデータを一覧にする ---------------------------------------------------------
base_url <- "https://www.e-stat.go.jp"
df_item <-
seq.int(2) |>
purrr::map(
@uribo
uribo / URL
Last active December 8, 2022 01:29
https://mybinder.org/v2/gh/uribo/binder221202/main?urlpath=git-pull?repo=https://github.com/uribo/cue2022aw_r104
@uribo
uribo / zip_to_administration.R
Last active September 28, 2022 04:32
郵便番号から該当する都道府県・市区町村・町域名、jis codeを検索
read_zipcode_oogaki <-
memoise::memoise(
function(.path) {
dplyr::select(zipangu::read_zipcode(.path,
type = "oogaki"),
jis_code, zip_code, prefecture, city, street)
}
)
zip_to_administration <- function(x, value = "jis_code", .path = NULL) {
apple_book_name_fix <- function(data) {
purrr::set_names(data,
stringr::str_to_lower(
stringr::str_remove(names(data), "^Z")
))
}
apple_book_markers <- function() {
con <- DBI::dbConnect(RSQLite::SQLite(),
"~/Library/Containers/com.apple.iBooksX/Data/Documents/AEAnnotation/AEAnnotation_v10312011_1727_local.sqlite",
@uribo
uribo / vis_tide_level.R
Last active October 7, 2021 21:43
複数地点の潮位データをプロット
library(dplyr)
library(jmastats)
library(ggplot2)
library(ggforce)
# 対象地点のデータを取得 -------------------------------------------------------------
# 東京
df_tk <-
read_tide_level(.year = 2020, .month = 8, .stn = "TK")