-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.Rmd
121 lines (81 loc) · 5.33 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
warning = FALSE,
message = FALSE,
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# lindol: An Interface to the PHIVOLCS Earthquake Bulletins <img src="man/figures/logo.png" width="200" align="right" />
<!-- badges: start -->
[![Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html#experimental)
[![R-CMD-check.yaml](https://github.com/panukatan/lindol/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/panukatan/lindol/actions/workflows/R-CMD-check.yaml)
[![test-coverage.yaml](https://github.com/panukatan/lindol/actions/workflows/test-coverage.yaml/badge.svg)](https://github.com/panukatan/lindol/actions/workflows/test-coverage.yaml)
[![Codecov test coverage](https://codecov.io/gh/panukatan/lindol/branch/main/graph/badge.svg)](https://app.codecov.io/gh/panukatan/lindol?branch=main)
[![CodeFactor](https://www.codefactor.io/repository/github/panukatan/lindol/badge)](https://www.codefactor.io/repository/github/panukatan/lindol)
[![DOI](https://zenodo.org/badge/841075120.svg)](https://zenodo.org/badge/latestdoi/841075120)
<!-- badges: end -->
The [Philippine Institute of Volcanology and Seismology (PHIVOLCS)](https://phivolcs.dost.gov.ph/) maintains the National Earthquake Monitoring and Information which aims to provide accurate and timely information on significant earthquakes and tsunami events that may significantly impact the Philippines and ensures the accessibility and integrity of earthquake data.
This package provides an interface to this information with functions that harvest, process, and structure information from the frequent earthquake bulletins released by PHIVOLCS into machine-readable versions.
The package name **lindol** (pronounced */linˈdol/ [lɪn̪ˈd̪ol]*) is the Tagalog word for earthquake.
## What does `lindol` do?
The `lindol` package provides functions that harvest, process, and structure information from the PHIVOLCS earthquake bulletins. Currently, `lindol` has functions for:
1. Building URLs for archived and current webpages that contain real-time earthquake information;
2. Extracting tabular data from webpages containing real-time earthquake information; and,
3. Processing tabular data from webpages containing real-time earthquake information.
## Installation
`lindol` is not yet on CRAN but can be installed through the panukatan R Universe with:
```R
install.packages(
"lindol",
repos = c("https://panukatan.r-universe.dev", "https://cloud.r-project.org")
)
```
## Usage
The main usage of `lindol` is to retrieve earthquake monitoring data from PHIVOLCS's earthquake bulletins. The main function is `eq_data()` and can be used as follows:
```{r usage-1a, eval = FALSE}
## Load the package ----
library(lindol)
## Get the current year and current month data ----
eq_data()
```
which provides a tibble output as follows:
```{r usage-1b, echo = FALSE}
## Load the package ----
library(lindol)
## Get the current year and current month data ----
eq_data()
```
The output has 7 fields:
* `date_time_retrieved` - Date and time (of type `POSIXct`/`POSIXt`) the data has been retrieved from the PHIVOLCS earthquake monitoring bulletins. This is basically a time stamp on when the user made a call to `eq_data()`;
* `date_time` - Date and time (of type `POSIXct`/`POSIXt`) the specific earthquake was detected and recorded. This is recorded in Philippine Standard Time (PST);
* `longitude` - Longitude (in GPS units/decimal format) coordinate of the hypocentre of the detected earthquake;
* `latitude` - Latitude (in GPS units/decimal format) coordinate of the hypocentre of the detected earthquake;
* `depth` - Depth (in kilometres units) of the hypocentre of the detected earthquake;
* `magnitude` - Magnitude of the earthquake; and,
* `location` - Location of the earthquake in relation to a monitoring station.
The default implementation of the `eq_data()` function outputs earthquake monitoring data for the current month of the current year. If data for a specific year is needed, say for example for year 2020, then:
```{r, usage-2a, eval = FALSE}
## Retrieve data for all months of year 2020 ----
eq_data(.year = 2020)
```
which gives:
```{r, usage-2b, echo = FALSE}
## Retrieve data for all months of year 2020 ----
eq_data(.year = 2020)
```
## Citation
If you find the `lindol` package useful please cite using the suggested citation provided by a call to the `citation()` function as follows:
```{r citation}
citation("lindol")
```
## Community guidelines
Feedback, bug reports and feature requests are welcome; file issues or seek support [here](https://github.com/panukatan/lindol/issues). If you would like to contribute to the package, please see our [contributing guidelines](https://panukatan.io/lindol/CONTRIBUTING.html).
This project is released with a [Contributor Code of Conduct](https://panukatan.io/lindol/CODE_OF_CONDUCT.html). By participating in this project you agree to abide by its terms.