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(httr2) | |
library(rvest) | |
# ページリスト ------------------------------------------------------------------ | |
req <- | |
request("https://scrapbox.io/") |> | |
req_url_path_append("api/pages/") |> | |
req_url_path_append("mandaRa") | |
x <- | |
req |> |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
############################## | |
# 作物統計調査のデータをダウンロードして綺麗な形でRに読み込む | |
# 表分類: 品目別結果樹面積、収穫量及び出荷量累年統計(昭和48年~) | |
############################## | |
# 1. 対象のデータを一覧にする --------------------------------------------------------- | |
base_url <- "https://www.e-stat.go.jp" | |
df_item <- | |
seq.int(2) |> | |
purrr::map( |
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
https://mybinder.org/v2/gh/uribo/binder221202/main?urlpath=git-pull?repo=https://github.com/uribo/cue2022aw_r104 |
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_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) { |
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
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", |
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(DiagrammeR) | |
library(remoji) | |
nodes <- | |
create_nodes( | |
nodes = c( | |
paste0(emoji("floppy_disk"), "Import"), | |
paste0(emoji("repeat"), "Tidy"), | |
paste( | |
paste0( |
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
###################################### | |
# 農林水産省 過去の主な異常災害等と農林水産被害 | |
# http://www.maff.go.jp/j/saigai/arc/index-1.html | |
###################################### | |
# 1/3 Setup ------------------------------------------------------------------- | |
library(dplyr) | |
library(purrr) | |
library(stringr) | |
bind_line2df <- function(x, index) { | |
x[index] %>% |
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 <- |
NewerOlder