daily_fips
to a separate folder
within a given directory. This function therefore allows you to pull and
save weather data time series for multiple counties at once.
The dataframe daily_data
is saved to a
a subdirectory of the given directory called "data." This timeseries
dataframe gives the values for specified weather variables and the
number of weather stations contributing to the average value for each day
within the specified date range. The element station_metadata
, which
gives information about stations contributing to the time series, as well as
statistical information about the values contributed by these stations, is saved
in a subdirectory called "metadata." The element station_map
, which is
a map of contributing station locations, is saved in a subdirectory called
"maps."
write_daily_timeseries(fips, coverage = NULL, date_min = NULL, date_max = NULL, var = "all", out_directory, data_type = "rds", metadata_type = "rds", average_data = TRUE, station_label = FALSE, keep_map = TRUE, verbose = TRUE)
coverage = 0
).)var = c("tmin", "tmax", "prcp")
for maximum temperature,
minimum temperature, and precipitation. The default is "all"
,
which includes all available weather variables at any weather station in
the county. For a full list of all
possible variable names, see NOAA's README file for the Daily Global
Historical Climatology Network (GHCN-Daily) at
http://www1.ncdc.noaa.gov/pub/data/ghcn/daily/readme.txt. Many of
the weather variables are available for some, but not all, monitors, so
your output from this function may not include all the variables
specified using this argument. If you specify a variable here but it is
not included in the output dataset, it means that it was not available in
the time range for any monitor in the county.data_type
and metadata_type
, respectively.
Maps are saved as .png files.
## Not run:
# write_daily_timeseries(fips = c("37055", "15005"), coverage = 0.90,
# date_min = "1995-01-01", date_max = "1995-01-31",
# var = c("tmax", "tmin", "prcp"),
# out_directory = "~/timeseries")
# ## End(Not run)
Run the code above in your browser using DataLab