Package darksky. September 20, 2017

Similar documents
Package opencage. January 16, 2018

Package robotstxt. November 12, 2017

Package fitbitscraper

Package cattonum. R topics documented: May 2, Type Package Version Title Encode Categorical Features

Package gtrendsr. August 4, 2018

Package gtrendsr. October 19, 2017

Package geniusr. December 6, 2017

Package geojsonsf. R topics documented: January 11, Type Package Title GeoJSON to Simple Feature Converter Version 1.3.

Package rdryad. June 18, 2018

Package wikitaxa. December 21, 2017

Package clipr. June 23, 2018

Package bigqueryr. October 23, 2017

Package fastdummies. January 8, 2018

Package rnrfa. April 13, 2018

Package swatches. December 21, 2017

Package loggit. April 9, 2018

Package spark. July 21, 2017

Package BANEScarparkinglite

Package bigqueryr. June 8, 2018

Package imdbapi. April 24, 2018

Package riingo. April 16, 2018

Package htmltidy. September 29, 2017

Package rgdax. January 7, 2019

Package dbx. July 5, 2018

Package geogrid. August 19, 2018

Package guardianapi. February 3, 2019

Package datasets.load

Package statsdk. September 30, 2017

Package aws.transcribe

Package goodpractice

Package tidytransit. March 4, 2019

Package dkanr. July 12, 2018

Package nlgeocoder. October 8, 2018

Package oec. R topics documented: May 11, Type Package

Package canvasxpress

Package ggimage. R topics documented: December 5, Title Use Image in 'ggplot2' Version 0.1.0

Package messaging. May 27, 2018

Package sessioninfo. June 21, 2017

Package humanize. R topics documented: April 4, Version Title Create Values for Human Consumption

Package io. January 15, 2018

Package virustotal. May 1, 2017

Package repec. August 31, 2018

Package BiocManager. November 13, 2018

Package githubinstall

Package crossword.r. January 19, 2018

Package ggimage. R topics documented: November 1, Title Use Image in 'ggplot2' Version 0.0.7

Package bupar. March 21, 2018

Package docxtools. July 6, 2018

Package cregulome. September 13, 2018

Package data.world. April 5, 2018

Package memoise. April 21, 2017

Package gridgraphics

Package bigreadr. R topics documented: August 13, Version Date Title Read Large Text Files

Package autocogs. September 22, Title Automatic Cognostic Summaries Version 0.1.1

Package rbraries. April 18, 2018

Package fastqcr. April 11, 2017

Package gridextra. September 9, 2017

Package RPresto. July 13, 2017

Package farver. November 20, 2018

Package revealjs. R topics documented: March 13, Type Package

Package facerec. May 14, 2018

Package strat. November 23, 2016

Package httpcache. October 17, 2017

Package wbstats. R topics documented: January 3, Type Package

Package barcoder. October 26, 2018

Package osrm. November 13, 2017

Package qualmap. R topics documented: September 12, Type Package

Package customlayout

Package censusr. R topics documented: June 14, Type Package Title Collect Data from the Census API Version 0.0.

Package smapr. October 20, 2017

Package internetarchive

Package profvis. R topics documented:

Package patentsview. July 12, 2017

Package nodbi. August 1, 2018

Package knitrprogressbar

Package rcmdcheck. R topics documented: November 10, 2018

Package projector. February 27, 2018

Package postal. July 27, 2018

Package jpmesh. December 4, 2017

Package rvg. February 13, 2018

Package caretensemble

Package spelling. December 18, 2017

Package rwars. January 14, 2017

Package gggenes. R topics documented: November 7, Title Draw Gene Arrow Maps in 'ggplot2' Version 0.3.2

Package meme. December 6, 2017

Package pkgbuild. October 16, 2018

Package rzeit2. January 7, 2019

Package PxWebApiData

Package pdfsearch. July 10, 2018

Package frequencyconnectedness

Package seeclickfixr

Package zip. R topics documented: March 11, Title Cross-Platform 'zip' Compression Version 2.0.1

Package meme. November 2, 2017

Package websearchr. R topics documented: October 23, 2018

Package promote. November 15, 2017

Package QCAtools. January 3, 2017

Package vinereg. August 10, 2018

Package available. November 17, 2017

Package IATScore. January 10, 2018

Package labelvector. July 28, 2018

Transcription:

Type Package Title Tools to Work with the 'Dark Sky' 'API' Version 1.3.0 Date 2017-09-20 Maintainer Bob Rudis <bob@rud.is> Package darksky September 20, 2017 Provides programmatic access to the 'Dark Sky' 'API' <https://darksky.net/dev/docs>, which provides current or historical global weather conditions. URL https://github.com/hrbrmstr/darksky Suggests testthat, covr Imports stats, httr, grid, gridextra, gtable, ggplot2, plyr, utils Depends R (>= 3.2.0) License MIT + file LICENSE BugReports https://github.com/hrbrmstr/darksky/issues RoxygenNote 6.0.1 NeedsCompilation no Author Bob Rudis [aut, cre], Lasse Vilhelmsen [ctb], David Severski [ctb] Repository CRAN Date/Publication 2017-09-20 11:49:20 UTC R topics documented: darksky........................................... 2 darksky_api_key...................................... 2 get_current_forecast.................................... 3 get_forecast_for....................................... 4 plot.darksky......................................... 5 print.darksky........................................ 6 Index 7 1

2 darksky_api_key darksky Tools to Work with the Dark Sky API Programmatic access to the Dark Sky API <https://darksky.net/dev/docs>, which provides current or historical global weather conditions. Author(s) Bob Rudis (bob@rud.is) darksky_api_key Get or set DARKSKY_API_KEY value The API wrapper functions in this package all rely on a Dark Sky API key residing in the environment variable DARKSKY_API_KEY. The easiest way to accomplish this is to set it in the.renviron file in your home directory. darksky_api_key(force = FALSE) force force setting a new Dark Sky API key for the current environment? atomic character vector containing the Dark Sky API key

get_current_forecast 3 get_current_forecast Retrieve the current forecast (for the next week) The Dark Sky API lets you query for most locations on the globe, and returns: 1. current conditions 2. minute-by-minute forecasts out to 1 hour (where available) 3. hour-by-hour forecasts out to 48 hours 4. day-by-day forecasts out to 7 days get_current_forecast(latitude, longitude, units = "us", language = "en", exclude = NULL, extend = NULL, add_json = FALSE, add_headers = FALSE,...) Details latitude longitude units language exclude extend add_json add_headers forecast latitude (character, decimal format) forecast longitude (character, decimal format) return the API response in units other than the default Imperial unit return text summaries in the desired language exclude some number of data blocks from the API response. This is useful for reducing latency and saving cache space. This should be a comma-separated string (without spaces) including one or more of the following: (currently, minutely, hourly, daily, alerts, flags). Crafting a request with all of the above blocks excluded is exceedingly silly and not recommended. Setting this parameter to NULL (the default) does not exclude any parameters from the results. setting this parameter to hourly the API will return hourly data for the next seven days, rather than the next two. add the raw JSON response to the object? add the return headers to the object?... pass through parameters to httr::get (e.g. to configure ssl options or proxies) If you wish to have results in something besides Imperial units, set units to one of (si, ca, uk). Setting units to auto will have the API select the relevant units automatically, based on geographic location. This value is set to us (Imperial) units by default. If you wish to have text summaries presented in a different language, set language to one of (ar, bs, de, es, fr, it, nl, pl, pt, ru, sv, tet, tr, x-pig-latin, zh). This value is set to en (English) by default. See the Options section of the official Dark Sky API documentation for more information.

4 get_forecast_for an darksky object that contains the original JSON response object (optionally), a list of named tbl_df data.frame objects corresponding to what was returned by the API and (optionally) relevant response headers (cache-control, expires, x-forecast-api-calls, x-response-time). Examples ## Not run: tmp <- get_current_forecast(37.8267, -122.423) ## End(Not run) get_forecast_for Retrieve weather data for a specific place/time Query for a specific time, past or future (for many places, 60 years in the past to 10 years in the future). get_forecast_for(latitude, longitude, timestamp, units = "us", language = "en", exclude = NULL, add_json = FALSE, add_headers = FALSE,...) latitude longitude timestamp units language exclude forecast latitude (character, decimal format) forecast longitude (character, decimal format) should either be a UNIX time (that is, seconds since midnight GMT on 1 Jan 1970) or a string formatted as follows: [YYYY]-[MM]-[DD]T[HH]:[MM]:[SS] (with an optional time zone formatted as Z for GMT time or [+ -][HH][MM] for an offset in hours or minutes). For the latter format, if no timezone is present, local time (at the provided latitude and longitude) is assumed. (This string format is a subset of ISO 8601 time. An as example, 2013-05-06T12:00:00-0400.) If an R Date or POSIXct object is passed in it will be converted into the proper format. return the API response in units other than the default Imperial unit return text summaries in the desired language exclude some number of data blocks from the API response. This is useful for reducing latency and saving cache space. This should be a comma-separated string (without spaces) including one or more of the following: (currently, minutely, hourly, daily, alerts, flags). Crafting a request with all of the above blocks excluded is exceedingly silly and not recommended. Setting this parameter to NULL (the default) does not exclude any parameters from the results.

plot.darksky 5 add_json add the raw JSON response to the object? add_headers add the return headers to the object?... pass through parameters to httr::get (e.g. to configure ssl options or proxies) Details If you wish to have results in something besides Imperial units, set units to one of (si, ca, uk). Setting units to auto will have the API select the relevant units automatically, based on geographic location. This value is set to us (Imperial) units by default. If you wish to have text summaries presented in a different language, set language to one of (ar, bs, de, es, fr, it, nl, pl, pt, ru, sv, tet, tr, x-pig-latin, zh). This value is set to en (English) by default. See the Options section of the official Dark Sky API documentation for more information. an darksky object that contains the original JSON response object (optionally), a list of named tbl_df data.frame objects corresponding to what was returned by the API and (optionally) relevant response headers (cache-control, expires, x-forecast-api-calls, x-response-time). Examples ## Not run: tmp <- get_forecast_for(37.8267,-122.423, "2013-05-06T12:00:00-0400") ## End(Not run) plot.darksky Plot method for darksky objects Uses ggplot2 & grid.arrange to produce graphs for darksky objects ## S3 method for class 'darksky' plot(x,..., readings = c("hourly", "minutely", "daily")) x a darksky x... ignored readings specify which readings to plot. will plot all available by default

6 print.darksky frame grob Note only forecast/readings components of x that have more than one observation will be plotted print.darksky Slightly more human-readable output for darksky objects Slightly more human-readable output for darksky objects ## S3 method for class 'darksky' print(x,...) x... ignored a darksky object

Index darksky, 2 darksky-package (darksky), 2 darksky_api_key, 2 get_current_forecast, 3 get_forecast_for, 4 plot.darksky, 5 print.darksky, 6 7