argo_filter: Select rows of Argo tables

Description Usage Arguments Value Examples

Description

These functions are intended to be applied to argo_global_meta() and other global index tables in the argo_global_*() family.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
argo_filter_radius(tbl, latitude, longitude, radius_km)

argo_filter_rect(tbl, latitude_min, latitude_max, longitude_min, longitude_max)

argo_filter_date(tbl, date_min, date_max = Sys.time())

argo_filter_updated(tbl, date_update_min, date_update_max = Sys.time())

argo_filter_float(tbl, float)

argo_filter_parameter(tbl, parameter)

argo_filter_data_mode(tbl, data_mode)

argo_filter_parameter_data_mode(tbl, parameter, data_mode)

argo_filter_direction(tbl, direction)

Arguments

tbl

A data.frame, ideally derived from argo_global_meta() and family. The column conventions used by the global indexes is assumed (e.g., columns latitude and longitude exist).

latitude, longitude

A location.

radius_km

A radius from the point described by latitude and longitude.

latitude_max, latitude_min, longitude_max, longitude_min

A rectangle describing the desired bounds. A rectangle where longitude_min is greater than longitude_max are interpreted as wrapping across the international date line.

date_min, date_max, date_update_min, date_update_max

A range of datetimes. Users are responsible for setting the timezone for these objects and are encouraged to used UTC.

float

A float identifier.

parameter

One or more (case insensitive) parameter names in which to search the parameters column of the bio-prof and synthetic-prof index files.

data_mode

One of "realtime" or "delayed".

direction

One of "ascending" or "descending"

Value

tbl with rows that match the search criteria.

Examples

 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
library(dplyr, warn.conflicts = FALSE)

## Not run: 
argo_global_prof() %>%
  # within 500 km of Halifax, Nova Scotia
  argo_filter_radius(45, -64, 500)

## End(Not run)

with_argo_example_cache({
  argo_global_traj() %>%
    argo_filter_rect(40, 60, -64, -54)
})

with_argo_example_cache({
  argo_global_traj() %>%
    argo_filter_updated("2020-01-01 00:00") %>%
    select(date_update, everything())
})

with_argo_example_cache({
  argo_global_traj() %>%
    argo_filter_float(c("13857", "15851"))
})

with_argo_example_cache({
  argo_global_traj() %>%
    argo_filter_data_mode("delayed")
})

ArgoCanada/argodata documentation built on Dec. 13, 2021, 10:13 a.m.