Package 'lindol'

Title: An Interface to the PHIVOLCS Earthquake Bulletins
Description: The Philippine Institute of Volcanology and Seismology (PHIVOLCS) 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 harvests, processes, and structures information from the frequent earthquake bulletins released by PHIVOLCS into machine-readable versions.
Authors: Ernest Guevarra [aut, cre]
Maintainer: Ernest Guevarra <[email protected]>
License: GPL (>= 3)
Version: 0.0.0.9000
Built: 2025-02-15 05:25:46 UTC
Source: https://github.com/panukatan/lindol

Help Index


Build URLs for specific PHIVOLCS earthquake bulletin summaries

Description

Build URLs for specific PHIVOLCS earthquake bulletin summaries

Usage

eq_build_url(
  .url = "https://earthquake.phivolcs.dost.gov.ph/",
  .year = NULL,
  .month = NULL
)

Arguments

.url

Base URL for PHIVOLCS earthquake bulletin summaries.

.year

A vector for year (in YYYY format) for which earthquake bulletins are to be retrieved. The earliest year that can be specified is 2018. If set to NULL (default), all years starting from 2018 to present year are used.

.month

A vector for month for which earthquake bulletins are to be retrieved. This can be set as either an integer index (1 for January) or abbreviation (Jan for January) for full name. If set to NULL (default), all months are used.

Value

A vector of URLs based on given .year and .month

Examples

eq_build_url()

Retrieve earthquake information data from PHIVOLCS bulletins

Description

Retrieve earthquake information data from PHIVOLCS bulletins

Usage

eq_data_summary(
  .url = "https://earthquake.phivolcs.dost.gov.ph/",
  .year = NULL,
  .month = NULL,
  latest = TRUE
)

eq_data_bulletin(
  .url = "https://earthquake.phivolcs.dost.gov.ph/",
  .year = NULL,
  .month = NULL,
  latest = TRUE
)

Arguments

.url

Base URL for PHIVOLCS earthquake bulletins.

.year

A vector for year (in YYYY format) for which earthquake bulletins are to be retrieved. The earliest year that can be specified is 2018. If set to NULL (default), all years starting from 2018 to present year are used.

.month

A vector for month for which earthquake bulletins are to be retrieved. This can be set as either an integer index (1 for January) or abbreviation (Jan for January) for full name. If set to NULL (default), all months are used.

latest

Logical. Should the latest table of earthquake information be retrieved? Only evaluated if .year = NULL and .month = NULL. If TRUE (default), table of earthquake information for current year and current month is retrieved. Otherwise, all months for all possible years are retrieved.

Value

A tibble of processed earthquake data.

Examples

eq_data_summary()

Retrieve raw information from PHIVOLCS earthquake information bulletins

Description

Retrieve raw information from PHIVOLCS earthquake information bulletins

Usage

eq_get_bulletin(.url)

eq_get_bulletins(.url)

Arguments

.url

A character value or vector of values for PHIVOLCS earthquake information bulletins

Value

A tibble of earthquake information from PHIVOLCS bulletins

Examples

urls <- eq_get_bulletin_urls()
eq_get_bulletins(urls[1:3])

Get PHIVOLCS earthquake information bulletins

Description

Get PHIVOLCS earthquake information bulletins

Usage

eq_get_bulletin_urls(
  .url = "https://earthquake.phivolcs.dost.gov.ph/",
  .year = NULL,
  .month = NULL,
  latest = TRUE
)

eq_get_bulletin_urls_(.url)

Arguments

.url

Base URL for PHIVOLCS earthquake bulletins.

.year

A vector for year (in YYYY format) for which earthquake bulletins are to be retrieved. The earliest year that can be specified is 2018. If set to NULL (default), all years starting from 2018 to present year are used.

.month

A vector for month for which earthquake bulletins are to be retrieved. This can be set as either an integer index (1 for January) or abbreviation (Jan for January) for full name. If set to NULL (default), all months are used.

latest

Logical. Should the latest table of earthquake information be retrieved? Only evaluated if .year = NULL and .month = NULL. If TRUE (default), table of earthquake information for current year and current month is retrieved. Otherwise, all months for all possible years are retrieved.

Value

A character vector of URLs for PHIVOLCS earthquake information bulletins.

Examples

eq_get_bulletin_urls()

Get earthquake monitoring information from PHIVOLCS earthquake bulletin HTMLs

Description

Get earthquake monitoring information from PHIVOLCS earthquake bulletin HTMLs

Usage

eq_get_tables(
  .url = "https://earthquake.phivolcs.dost.gov.ph/",
  .year = NULL,
  .month = NULL,
  latest = TRUE
)

eq_get_table(.url)

Arguments

.url

Base URL for PHIVOLCS earthquake bulletins.

.year

A vector for year (in YYYY format) for which earthquake bulletins are to be retrieved. The earliest year that can be specified is 2018. If set to NULL (default), all years starting from 2018 to present year are used.

.month

A vector for month for which earthquake bulletins are to be retrieved. This can be set as either an integer index (1 for January) or abbreviation (Jan for January) for full name. If set to NULL (default), all months are used.

latest

Logical. Should the latest table of earthquake information be retrieved? Only evaluated if .year = NULL and .month = NULL. If TRUE (default), table of earthquake information for current year and current month is retrieved. Otherwise, all months for all possible years are retrieved.

Value

A list of tibble/s of raw earthquake information from PHIVOLCS.

Examples

eq_get_tables()

Process earthquake information from PHIVOLCS bulletins

Description

Process earthquake information from PHIVOLCS bulletins

Usage

eq_process_bulletins(eq_df)

Arguments

eq_df

A tibble of earthquake information from PHIVOLCS bulletins retrieved using eq_get_bulletins().

Value

A tibble of processed earthquake information from PHIVOLCS bulletins.

Examples

urls <- eq_get_bulletin_urls()
eq_get_bulletins(urls[1:3]) |>
  eq_process_bulletins()

Process tabular data extracted from bulletins

Description

Process tabular data extracted from bulletins

Usage

eq_process_tables(eq_data_list)

eq_process_table(eq_data_list)

Arguments

eq_data_list

A list of tibble/s of raw earthquake data extracted from PHIVOLCS earthquake information monitoring HTMLs using eq_get_table.

Value

A tibble of processed earthquake data summaries.

Examples

eq_tab <- eq_get_tables()
eq_process_tables(eq_tab)