openweather_request: Send a request to the OPEN WEATHER API

Description Usage Arguments Value API Documentation

Description

Send a general request to the OPEN WEATHER API by specifying an endpoint and a sequence of parameters. The 'openweather_request()' function forms and submits a request to a specified endpoint of the OPEN WEATHER API. The return is either the 'response' object from GET or the response parsed as a 'tibble'.

Usage

1
openweather_request(..., to_frame = TRUE, print_req = FALSE)

Arguments

...

A series of named parameters to be used in the query. Must be of the form 'param_key = "param_value"'. Acceptable parameters are endpoint-specific.

to_frame

A boolean value indicating whether or not the response should be parsed and formatted as a data frame. If 'FALSE', a 'response' object is returned and further processing can be done with content. Default is 'TRUE'.

print_req

A boolean value indicating whether or not the request should be printed as well. Useful for debugging. Default is 'FALSE'.

endpoint

A string representing the OPEN WEATHER API endpoint of interest. _Required parameter._

Value

If 'to_frame = TRUE', a 'tibble' containing the parsed response. If 'to_frame = FALSE', a 'response' object returned directly from GET.

API Documentation

[Open Weather Map API](https://openweathermap.org/api)


alexhallam/OpenWeatherPull documentation built on May 6, 2019, 7:02 p.m.