Title: | Geyser Data from GeyserTimes.org |
---|---|
Description: | Download geyser eruption and observation data from the GeyserTimes site (<https://geysertimes.org>) and optionally store it locally. The vignette shows a simple analysis of downloading, accessing, and summarizing the data. |
Authors: | Stephen Kaluzny [aut, cre] |
Maintainer: | Stephen Kaluzny <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.1.9 |
Built: | 2025-03-12 05:15:04 UTC |
Source: | https://github.com/geysertimes/geysertimes-r-package |
Removes a particular version of the GeyserTimes data files
that have been download and stored on disk by gt_get_data
.
Alternatively, the function will remove all old versions
of the GeyserTimes data files,
keeping only the most recent files.
gt_cleanup_data(version = NULL, old = FALSE, path = gt_path())
gt_cleanup_data(version = NULL, old = FALSE, path = gt_path())
version |
a character value,
the specific version of the GeyserTimes data files to be removed.
The version number is the date that the files were downloaded,
with the format |
old |
a logical value, if |
path |
a character value, the location on disk where the GeyserTimes data files. |
Users who regularly download the latest GeysersTimes data may
want to call gt_cleanup_data(old=TRUE)
to
clean out old copies of the data.
a character vector, the versions of the data files that were removed.
If no files are removed, NULL
is returned.
Stephen Kaluzny <[email protected]>
# see the example in the gt_get_data help file.
# see the example in the gt_get_data help file.
Downloads the data from geysertimes.org. Reads the data and creates a tibble object in 'dest_folder'.
gt_get_data(dest_folder = file.path(tempdir(), "geysertimes"), overwrite = FALSE, quiet = FALSE, version = lubridate::today())
gt_get_data(dest_folder = file.path(tempdir(), "geysertimes"), overwrite = FALSE, quiet = FALSE, version = lubridate::today())
dest_folder |
the location where the binary tibble object should be written. The default is under the current R session's temp directory which will disappear when the session ends. |
overwrite |
a logical value,
if |
quiet |
a logical value, if |
version |
a character string giving the version of the data to download.
This should a date in the form |
The data is downloaded from the GeyserTimes archive web site
https://geysertimes.org/archive/ to the tempdir()
directory.
The data is then read with readr::read_tsv
with appropriate
column types.
The resulting tibble
object is then saved as an binary (.rds
)
in dest_folder
.
a character string giving the full path to the directory where the GeyserTimes data was stored.
Users are encouraged to set dest_folder
to gt_path()
to save
a persistent copy of the data.
Stephen Kaluzny <[email protected]>.
gt_load_eruptions, gt_load_geysers.
dpath0 <- gt_get_data() # data saved under tempdir() dpath1 <- gt_get_data(dest=gt_path()) # data saved under gt_path() gt_cleanup_data(gt_version())
dpath0 <- gt_get_data() # data saved under tempdir() dpath1 <- gt_get_data(dest=gt_path()) # data saved under gt_path() gt_cleanup_data(gt_version())
Loads the Geyser Times data that was previously downloaded by a call
to gt_get_data
.
gt_load_eruptions(path = gt_path(), quiet = FALSE, version = NULL) gt_load_geysers(path = gt_path(), quiet = FALSE, version = NULL)
gt_load_eruptions(path = gt_path(), quiet = FALSE, version = NULL) gt_load_geysers(path = gt_path(), quiet = FALSE, version = NULL)
path |
a character string, the local location where the Geyser Times data
has been written.
The default is the local permanent location given by |
quiet |
a logical value, if |
version |
a character string giving the version of the Geyser Times data to load.
Calling |
Typically, a user would download the data once, with a call to 'gt_get_data(destdir=gt_path())'. Subsequent R sessions can the load this downloaded data with a call to 'gt_load_eruptions()'.
a tibble containing the Geyser Times data with names: (need to decide on appropriate names)
Stephen Kaluzny <[email protected]>
gt_get_data
## Not run: tmppath <- gt_get_data() erupt <- gt_load_eruptions() ## End(Not run)
## Not run: tmppath <- gt_get_data() erupt <- gt_load_eruptions() ## End(Not run)
Returns the path where local GeyserTimes data is stored.
gt_path(temp = FALSE)
gt_path(temp = FALSE)
temp |
a logical value, if |
a character string giving the full path where local GeyserTimes data is stored.
Prior to version 0.1.8, the geysertimes
package used a location
specified by rappdirs::user_data_dir
for storing local GeyserTimes data.
Starting with version 0.1.8, the package now uses the location
tools::R_user_dir("geysertimes", "data")
.
Stephen Kaluzny <[email protected]>
# The default location for the GeyserTimes data: gt_path()
# The default location for the GeyserTimes data: gt_path()
Returns the version of the current GeyserTimes data. This is a character string date in year-mm-dy format.
gt_version(path = gt_path(), quiet = FALSE, all = FALSE)
gt_version(path = gt_path(), quiet = FALSE, all = FALSE)
path |
the path to the GeyserTimes data. The default is the suggested location used by 'gt_get_data'. |
quiet |
a logical value, if |
all |
list all versions of the GeyserTimes data found, not just the newest. |
a character string listing the version(s) of GeyserTimes data stored under 'path'.
Stephen Kaluzny <[email protected]>
gt_version()
gt_version()