Skip to content

Commit

Permalink
[fix]竜王山のblock_no
Browse files Browse the repository at this point in the history
  • Loading branch information
uribo committed Sep 12, 2024
1 parent 6b8b863 commit 99330e7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions data-raw/station_list.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ if (!file.exists(here::here("data-raw/amedas_raw.rds"))) {
# csv上では「オホーツク」だが「網走・北見・紋別」
dplyr::mutate(area = dplyr::recode(area,
`オホーツク` = "網走・北見・紋別")) |>
ensurer::ensure(ncol(.) == 12L)
pointblank::col_count_match(12L)
# 1.2. scraping ---------------------------------------------------------------
read_block_no <- function(prec_no) {
url <-
Expand Down Expand Up @@ -126,14 +126,17 @@ if (!file.exists(here::here("data-raw/amedas_raw.rds"))) {
pointblank::row_count_match(1677L) |>
pointblank::col_count_match(4L) |>
dplyr::mutate(area = stringr::str_remove(area, "(都|府|県)$"),
# area = dplyr::if_else(station == "竜王山", "徳島", area),
area = dplyr::if_else(station == "竜王山", "徳島", area),
station = stringr::str_remove(station, "(.+)")) |>
dplyr::rename(station_name = station)

# https://www.data.jma.go.jp/stats/etrn/select/prefecture.php?prec_no=50&block_no=&year=&month=&day=&view=
df_stations |>
filter(station_name == "三倉", area == "静岡") |>
pointblank::row_count_match(2L) # 2地点でOK
df_stations |>
filter(station_name == "新島", area == "東京") |>
pointblank::row_count_match(2L) # 2地点でOK
df_amedas_master |>
filter(station_name == "高知", area == "高知") |>
pointblank::row_count_match(2L) # 2地点でOK
Expand Down Expand Up @@ -161,6 +164,10 @@ if (!file.exists(here::here("data-raw/amedas_raw.rds"))) {
# df_amedas_master |> filter(station_name == "ピヤシリ山")
# stations |> filter(station_name == "ピヤシリ山")

stations |>
filter(is.na(block_no)) |>
pointblank::row_count_match(0L)

stations |>
readr::write_rds("data-raw/amedas_raw.rds")
} else {
Expand Down
Binary file modified data/stations.rda
Binary file not shown.

0 comments on commit 99330e7

Please sign in to comment.