- action
is a character string to decide on 3 modes of action for the function.
'list_stations' returns a data frame with the information on weather stations that
are to the location defined by number_of_stations
and location
parameters.
'download_weather' retrieves the records for one or more weather stations defined
in the location
parameter.
If the input is a data frame previously downloaded with the mode 'download_weather',
the function will format the data frame using the chillR structure.
- location
accepts a numeric vector with two or three elements representing the longitude,
latitude, and elevation of a given place or a vector of character strings representing the ID
of the weather stations of interest.
If action = 'list_stations'
, location
requires the coordinates of the place and
optionally the elevation. This vector can be named or not. Valid names are:
'y'
, 'Y'
, 'latitude'
, 'lat'
, 'Latitude'
, 'Lat'
,
'LATITUDE'
, 'LAT'
for latitude, 'x'
,
'X'
, 'longitude'
, 'long'
, 'Longitude'
, 'Long'
,
'LONGITUDE'
, 'LONG'
for longitude, and 'z'
, 'Z'
, 'elevation'
,
'elev'
, 'Elevation'
, 'Elev'
, 'ELEVATION'
,
'ELEV'
for elevation. If action = 'download_weather'
, location
accepts
the ID of the station as character string.
- time_interval
numeric vector with two elements, specifying the start and end date
of the period of interest. Only required when running in 'list_stations'
or
'download_weather'
mode. Unlike other functions from the handle family,
handle_dwd
allows specifying the date in YEARMODA
format. Default is set to
19160101
(the earliest date on record) and the current date.
- station_list
accepts a data frame if the list of weather stations has already been
downloaded. The list can be passed to the function through this argument. This can save a bit
of time, since it can take a bit of time to download the list, which can have several
MB
.
- stations_to_choose_from
if the location is specified by geographic coordinates,
this argument
determines the number of nearby stations in the list that is returned.
- drop_most
boolean variable indicating if most columns should be dropped from the
file if a list of data frames is provided to the action
argument. If set to
TRUE
(the default), only essential columns for running chillR
functions are
retained.
- end_at_present
boolean variable indicating whether the interval of interest
should end on the present day, rather than extending until the end of the year specified
under time_interval[2]
(if time_interval[2]
is the current year).
DEPRECATED in this function since time_interval
already allows specifying
the present day.
- add.DATE
is a boolean parameter to be passed to make_all_day_table
if action
is a collection of outputs (in the form of list) from the function in the
downloading format.
- quiet
is a boolean parameter to be passed to
download.file
if action = "download_weather"
.
- add_station_name
is a boolean parameter to include the name of the respective weather
station in the resulting data frame in case the function is used in the downloading or
formatting mode.