query_metadata: Query CO-OPS API for Station Metadata

Description Usage Arguments Value Examples

View source: R/query_meta_data.R

Description

Provides easy access to the CO-OPS Metadata API. The api makes information about measurement stations available to users. Information about a single station or a collection of stations can be accessed. Depending on the type of station queried different information is returned.

Usage

1
2
3
4
5
6
7
8
9
query_metadata(
  station_id = NULL,
  resource = NULL,
  type = NULL,
  ports = NULL,
  units = "english",
  radius = NULL,
  bin = NULL
)

Arguments

station_id

an optional string that provides the a 7 character station id. If omitted the derived product API returns data for all stations.

resource

a character string indicating they type of information to request for a specific station. A list of resource identifiers is available in the API Documentation

type

a character string indicating the sensor of interest. Specifying a sensor of interest returns a data frame with all stations that have the particular sensor. A list of sensor identifiers is available in the API Documentation

ports

A two character string indicating specific ports.

units

a character string specifying if the data should be returned using metric or English units. Defaults to 'english'

radius

an optional numeric argument indicating the radius in nautical miles to search for nearby stations

bin

an optional (positive integer) argument to requests for currents station harmonic constituents. If not specified, all the bins will be returned.

Value

A data frame. The content of the data frame is dependent on the API call. See the API documentation for specifics.

Examples

1
2
3
4
5
# Query a single stations sensors.
sensor_df <- query_metadata('9414290', 'sensors')

# Query all stations
all_stations_df <- query_metadata()

warlicks/noaaoceans documentation built on May 14, 2021, 6:44 a.m.