get_locations: Get metadata for the location names defined in the Frost API

Description Usage Arguments Value Examples

View source: R/get_locations.R

Description

get_locations() retrieves metadata about location names defined for use in the Frost API. The function requires an input for client_id. The other function arguments are optional, and default to NULL, which means that the response from the API is not filtered on these parameters.

Usage

1
2
3
4
5
get_locations(client_id,
              names = NULL,
              geometry = NULL,
              fields = NULL,
              return_response = FALSE)

Arguments

client_id

A string. The client ID to use to send requests to the Frost API.

names

A character vector. The location names that you want metadata for.

geometry

A string. Get Frost API location names defined by a specified geometry. Geometries are specified as either "nearest(POINT(...))" or "POLYGON(...)" using well-known text representation for geometry (WKT).

fields

A character vector. Fields to include in the response (i.e. output). If this parameter is specified, then only these fields are returned in the response. If not specified, then all fields will be returned in the response.

return_response

A logical. If set to TRUE, then the function returns the response from the GET request. If set to FALSE (default), then the function returns a tibble (data frame) of the content in the response.

Value

The function returns either a data frame with metadata about location names, or the response of the GET request, depending on the boolean value set for return_response.

Examples

1
2
3
4
5
6
7
## Not run: 
frost_client_id <- "<YOUR FROST CLIENT ID>"

# Get all location names
locations_df <- get_locations(client_id = frost_client_id)

## End(Not run)

PersianCatsLikeToMeow/frostr documentation built on Aug. 6, 2020, 7:15 p.m.