jmastats
Download Weather Data from Japan Meteorological Agency Website
Science Score: 46.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: zenodo.org -
✓Committers with academic emails
1 of 5 committers (20.0%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.2%) to scientific vocabulary
Keywords
climate-change
rpackage
weather
Last synced: 6 months ago
·
JSON representation
Repository
Download Weather Data from Japan Meteorological Agency Website
Basic Info
- Host: GitHub
- Owner: uribo
- License: other
- Language: R
- Default Branch: main
- Homepage: https://uribo.github.io/jmastats/
- Size: 7.12 MB
Statistics
- Stars: 24
- Watchers: 4
- Forks: 2
- Open Issues: 2
- Releases: 4
Topics
climate-change
rpackage
weather
Created over 3 years ago
· Last pushed about 1 year ago
Metadata Files
Readme
Changelog
Funding
License
README.Rmd
---
output: github_document
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%",
eval = FALSE,
echo = TRUE
)
```
# jmastats
[](https://CRAN.R-project.org/package=jmastats)
[](https://cran.r-project.org/package=jmastats)
[](https://zenodo.org/badge/latestdoi/515892382)
jmastats は[気象庁](https://www.jma.go.jp/jma/index.html)のウェブサイトで公開される気象、地震、海洋等の各種データをR上で扱うためのパッケージです。
## インストール
CRANからインストールが可能です。
``` r
install.packages("jmastats")
```
開発版を利用したい場合は次のコマンドを実行することでインストールが行われます。
``` r
install.packages(
"jmastats",
repos = c(uribo = "https://uribo.r-universe.dev", getOption("repos")))
```
## 特徴
- 過去の気象データのほか、気象庁が公開するさまざまな気象ファイルをRで扱いやすい形式で読み込みます。
- 地理空間情報が利用できる場合、適切な種類(ポイント、ライン等)のsfオブジェクトに変換します。
- `parse_unit()`関数により、気象データの単位系(SI単位系)をunitsオブジェクトに変換します。
- 取得した気象データはコンピュータ内にキャッシュとして保存されます。そのため、一度取得したデータはインターネット接続ができない状態でも参照可能です。キャッシュの利用により、取得時の気象庁ウェブサイトへの負荷も軽減されます。
## 使い方
```{r}
#| eval: true
#| echo: true
library(jmastats)
```
### 地点気象データ
取得したい対象データを`item`引数に指定、観測所の位置する `block_no` と対象の年 `year` 月 `month` 日 `day`を必要に応じて与えて実行します。
```{r}
# データの種類: hourly (1時間ごとの値)
# ブロック番号: 47646 (「つくば」)
# 対象年月日: 2022年1月1日
jma_collect(item = "hourly", block_no = 47646, year = 2022, month = 1, day = 1)
```
`block_no` が不明の時は 対象地点の緯度経度を元に`nearest_station()`関数や後述の気象観測地点データから検索できます。
```{r}
# 任意の緯度経度座標から最寄りの観測所と座標との距離を出力
nearest_station(longitude = 140.112, latitude = 36.083)
```
ユーザーが任意の地点、項目、期間等の組みあわせで出力可能な、`過去の気象データ`のcsvファイルを読み込む関数として`read_jma_weather()`関数が利用できます。
```{r}
# ダウンロードしたcsvファイルのパスを与えて実行します
read_jma_weather(system.file("dummy/dl_data.csv", package = "jmastats"))
```
### 台風資料
気象庁のウェブサイト、[RMCS Tokyo](https://www.jma.go.jp/jma/jma-eng/jma-center/rsmc-hp-pub-eg/trackarchives.html)が提供する台風のベストトラックデータを読み込むための関数があります。
`read_rsmc_besttrack()`関数でベストトラックのファイルが置かれたパスを指定します。
```{r}
#| eval: true
read_rsmc_besttrack(path = system.file("dummy/bst.txt", package = "jmastats")) |>
dplyr::glimpse()
```
URLを直接指定した読み込みも可能です。
```{r}
read_rsmc_besttrack(path = "https://www.jma.go.jp/jma/jma-eng/jma-center/rsmc-hp-pub-eg/Besttracks/bst2023.txt")
```
`read_rsmc_besttrack()`関数の返り値は台風の経路を記録したポイントデータ(sf)となっています。`track_combine()`関数では、`read_rsmc_besttrack()`関数で読み込んだベストトラックのデータについて、台風ごとの経路をラインデータとしてまとめます。
```{r}
read_rsmc_besttrack(path = system.file("dummy/bst.txt", package = "jmastats")) |>
track_combine(group_vars = "storm_name")
```
### 気象庁防災情報XMLフォーマット
```{r}
read_kishou_feed("high", type = "regular")
read_kishou_feed("low", "other")
```
### 潮汐観測資料
```{r}
# URLを指定しての読み込み
read_tide_level("https://www.data.jma.go.jp/gmd/kaiyou/data/db/tide/suisan/txt/2020/TK.txt")
# URLを構成するパラメータを指定した読み込み
read_tide_level(.year = 2020, .month = 2, .stn = "TK")
```
```{r}
#| eval: true
# ローカルに保存したファイルの読み込み(パスを指定)
read_tide_level(system.file("dummy/tide.txt", package = "jmastats"))
```
### 震度データベース
[震度データベース検索](https://www.data.jma.go.jp/svd/eqdb/data/shindo/index.html)よりダウンロードしたcsvファイルを読み込む関数として`read_eqdb_csv()`があります。ダミーデータを読み込む例を示します。
```{r}
#| eval: true
read_eqdb_csv(system.file("dummy/eqdb.csv", package = "jmastats"))
```
### データセット
#### 気象観測地点
気象データを取得するための`block_no`はここからも調べることができます。
観測地点の配置された標高や観測種目のほか、観測地点の位置情報が含まれます。
```{r}
data("stations", package = "jmastats")
```
`station_type` により観測種目が異なります。
| 略字 | 観測装置の種類 | 観測種目 |
|------|:---------------|:---------|
| 四 | 有線ロボット気象計 | 降水量、気温、風向、風速、日照時間 |
| 三 | 有線ロボット気象計 | 降水量、気温、風向、風速 |
| 官 | 地上気象観測装置 | 降水量、気温、風向、風速、日照時間(一部の観測所を除く)、積雪の深さ(一部の観測所を除く) |
| 雨 | 有線ロボット気象計 | 降水量 |
| 雪 | 有線ロボット積雪計 | 積雪量 |
#### 潮位観測地点
潮位観測を行う地点についてのデータです。
stn変数の情報をもとにして、`read_tide_level()`での潮位観測記録の取得が行えます。
```{r}
data("tide_station", package = "jmastats")
```
#### 震度観測点
地震・津波を観測するためのポイントを記録したデータです。震度観測点は気象庁のほかに各地方公共団体や国立研究開発法人防災科学技術研究所の観測地点が設置されていますが、このデータには気象庁が管理する地点だけが含まれます。
```{r}
data("earthquake_station", package = "jmastats")
```
## 引用
このパッケージを利用した学術論文の出版、学会発表等を行う際は次のように引用を行ってください。
```{r}
#| eval: false
#| echo: false
#| results: 'asis'
print(citation("jmastats"), bibtex = FALSE)
```
```
Uryu S (2024). _jmastats: Download Weather Data from Japan Meteorological
Agency Website_. R package version 0.2.1,
.
```
```{r}
#| eval: false
#| echo: false
#| comment: ""
toBibtex(citation("jmastats"))
```
または
```
@Manual{,
title = {jmastats: Download Weather Data from Japan Meteorological Agency Website},
author = {Shinya Uryu},
year = {2024},
note = {R package version 0.2.2},
url = {https://CRAN.R-project.org/package=jmastats},
}
```
## 関連するパッケージ
- [worldmet](https://cran.r-project.org/package=worldmet)
- [rnoaa](https://cran.r-project.org/package=rnoaa)
- [GSODR](https://cran.r-project.org/package=GSODR)
- [stationaRy](https://cran.r-project.org/package=stationaRy)
- [rdwd](https://cran.r-project.org/package=rdwd)
- [weathercan](https://github.com/ropensci/weathercan)
- [aemet](https://github.com/SevillaR/aemet)
- [climate](https://github.com/bczernecki/climate)
- [rrricanes](https://github.com/ropensci/rrricanes)
Owner
- Name: Shinya Uryu
- Login: uribo
- Kind: user
- Location: Tokushima, Japan
- Company: Tokushima University (徳島大学)
- Website: https://uribo.hatenablog.com
- Twitter: u_ribo
- Repositories: 210
- Profile: https://github.com/uribo
R / Data Engineer / Geo / Ecology / Visualization / Tokushima University (徳島大学)
GitHub Events
Total
- Create event: 1
- Release event: 1
- Issues event: 7
- Watch event: 1
- Issue comment event: 4
- Push event: 12
Last Year
- Create event: 1
- Release event: 1
- Issues event: 7
- Watch event: 1
- Issue comment event: 4
- Push event: 12
Committers
Last synced: 6 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| Shinya Uryu | s****7@g****m | 138 |
| Shinya Uryu | u****a@n****p | 49 |
| Shinya Uryu | r****u@g****m | 30 |
| Shinya Uryu | u****a@t****p | 19 |
| BABA Yoshihiko | b****o@g****m | 1 |
Committer Domains (Top 20 + Academic)
tokushima-u.ac.jp: 1
nies.go.jp: 1
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 17
- Total pull requests: 8
- Average time to close issues: 15 days
- Average time to close pull requests: about 2 hours
- Total issue authors: 5
- Total pull request authors: 2
- Average comments per issue: 1.06
- Average comments per pull request: 0.13
- Merged pull requests: 8
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 5
- Pull requests: 1
- Average time to close issues: 5 days
- Average time to close pull requests: less than a minute
- Issue authors: 4
- Pull request authors: 1
- Average comments per issue: 1.0
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- uribo (9)
- kangjf1943 (5)
- kizen777 (1)
- XU159-claire (1)
- drat70 (1)
Pull Request Authors
- uribo (8)
- babayoshihiko (2)
Top Labels
Issue Labels
release 🚀 (1)
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 156 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 4
- Total maintainers: 1
cran.r-project.org: jmastats
Download Weather Data from Japan Meteorological Agency Website
- Homepage: https://uribo.github.io/jmastats/
- Documentation: http://cran.r-project.org/web/packages/jmastats/jmastats.pdf
- License: MIT + file LICENSE
-
Latest release: 0.3.0
published about 1 year ago
Rankings
Stargazers count: 13.0%
Dependent repos count: 24.4%
Dependent packages count: 28.0%
Forks count: 28.0%
Average: 33.1%
Downloads: 72.1%
Maintainers (1)
Last synced:
6 months ago
Dependencies
DESCRIPTION
cran
- R >= 4.1 depends
- cli >= 3.4.0 imports
- crayon >= 1.3.4 imports
- dplyr >= 1.1.0 imports
- forcats >= 0.4.0 imports
- ggplot2 >= 2.2.1 imports
- lifecycle >= 1.0.3 imports
- lubridate >= 1.7.4 imports
- purrr >= 1.0.2 imports
- rappdirs >= 0.3.3 imports
- readr >= 1.1.1 imports
- rlang >= 0.2.1 imports
- rvest >= 0.3.2 imports
- sf >= 0.6.3 imports
- stringr >= 1.3.1 imports
- tibble >= 3.0.0 imports
- tidyr >= 1.0.0 imports
- tidyselect >= 1.1.0 imports
- units >= 0.5.1 imports
- xml2 >= 1.2.0 imports
- knitr >= 1.20 suggests
- lwgeom >= 0.1 suggests
- rmarkdown >= 1.9 suggests
- testthat >= 2.0.0 suggests
.github/workflows/pkgdown.yaml
actions
- JamesIves/github-pages-deploy-action v4.4.1 composite
- actions/checkout v3 composite
- r-lib/actions/setup-pandoc v2 composite
- r-lib/actions/setup-r v2 composite
- r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/rhub.yaml
actions
- r-hub/actions/checkout v1 composite
- r-hub/actions/platform-info v1 composite
- r-hub/actions/run-check v1 composite
- r-hub/actions/setup v1 composite
- r-hub/actions/setup-deps v1 composite
- r-hub/actions/setup-r v1 composite