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
| read_ks_pop <- function(path, .tidy = TRUE) { | |
| d <- | |
| vroom::vroom(path, | |
| locale = vroom::locale(encoding = "cp932"), | |
| skip = 1, | |
| col_types = paste0(c("cii"), | |
| paste(rep("d", 42), collapse = ""), collapse = "")) | |
| fix_names <- | |
| stringi::stri_trans_nfkc(names(d)) %>% | |
| stringr::str_trim() %>% |
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(fgdr) | |
| library(purrr) | |
| library(sf) | |
| library(h3forr) | |
| library(ggplot2) | |
| sf_hex <- | |
| geo_to_h3(c(36.0670602, 140.0781036), res = 7) %>% | |
| h3_to_geo_boundary() %>% | |
| geo_boundary_to_sf() |
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(rlang) | |
| library(purrr, warn.conflicts = FALSE) | |
| library(glue) | |
| library(rAltmetric) | |
| # library(ghql) | |
| reference_style <- "oikos" | |
| path_references_bib <- "references.bib" | |
| qry <- ghql::Query$new() |
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(jmastats) | |
| library(dplyr) | |
| library(sf) | |
| library(assertr) | |
| df_bst_all <- | |
| read_rsmc_besttrack(path) %>% | |
| verify(dim(.) == c(65626, 22)) | |
| df_bst_all %>% |
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(jmastats) | |
| library(dplyr) | |
| library(sf) | |
| library(assertr) | |
| df_bst_all <- | |
| read_rsmc_besttrack(path) %>% | |
| verify(dim(.) == c(65626, 22)) | |
| df_bst_all %>% |
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
| ###################################### | |
| # 農林水産省 過去の主な異常災害等と農林水産被害 | |
| # 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 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(drake) | |
| library(dplyr) | |
| library(purrr) | |
| library(assertr) | |
| library(tabulizer) | |
| matrix_to_tbl <- function(data) { | |
| data %>% | |
| as.data.frame(stringsAsFactors = FALSE) %>% | |
| janitor::clean_names() %>% |
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(dplyr) | |
| library(sf) | |
| library(ggplot2) | |
| library(rcartocolor) | |
| library(ggrepel) | |
| library(gridExtra) |
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(tabulizer) | |
| tweak_kameiten_df <- function(data) { | |
| data %>% | |
| dplyr::filter(!is.na(`No.`)) %>% | |
| dplyr::mutate(還元率 = units::set_units(還元率, "%")) %>% | |
| dplyr::arrange(`No.`) %>% | |
| tibble::as_tibble() | |
| } | |
| kameiten_na <- function() { |
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(h3forr) | |
| library(jpmesh) | |
| library(sf) | |
| library(dplyr) | |
| library(mapview) | |
| sfc_poly_to_h3 <- function(geometry, res = 7) { | |
| coords <- sf::st_coordinates(sf::st_centroid(st_geometry(geometry))) | |
| h3forr::geo_to_h3(c(coords[2], coords[1]), res = res) | |
| } |