defStormsDataset {StormR} | R Documentation |
Creating a stormsDataset
object
Description
The defStormsDataset()
function creates a stormsDataset
object from either a NetCDF or a CSV file.
This is an essential first step before other stormR
functions can be used.
Usage
defStormsDataset(
filename = system.file("extdata", "test_dataset.nc", package = "StormR"),
sep = NULL,
fields = c(names = "name", seasons = "season", isoTime = "iso_time", lon = "usa_lon",
lat = "usa_lat", msw = "usa_wind", basin = "basin", rmw = "usa_rmw", pressure =
"usa_pres", poci = "usa_poci"),
basin = NULL,
seasons = c(1980, as.numeric(format(Sys.time(), "%Y"))),
unitConversion = c(msw = "knt2ms", rmw = "nm2km", pressure = "mb2pa", poci = "mb2pa"),
notNamed = "NOT_NAMED",
verbose = 1
)
Arguments
filename |
character. Name of the NetCDF (.nc)/CSV (.csv) file. Default is the |
sep |
character. The field separator character if |
fields |
named character vector. This argument allows to specify the corresponding variable names (NetCDF) or
headers (CSV) in the input file for each field in the output
|
basin |
character. If the basin field is provided, then storm track data will
only be extracted for the named basin. By default
|
seasons |
numeric vector. Seasons of occurrence of the storms (e.g., c(2020,2022)). In the Southern Hemisphere, the cyclone season extends across two consecutive years. Therefore, to capture the 2021 to 2022 cyclone season both years should be specified, with cyclones assigned for the year that originated in. By default all storms occurring since 1980 are extracted. |
unitConversion |
named character vector. For
For
For
|
notNamed |
character. Constant name for not named storms to remove in the database. Default value is "NOT_NAMED" (IBTrACS database) |
verbose |
numeric. Whether the function should display ( |
Value
The defStormsDataset()
function returns a stormsDataset
object.
References
Knapp, K. R., Kruk, M. C., Levinson, D. H., Diamond, H. J., & Neumann, C. J. (2010). The International Best Track Archive for Climate Stewardship (IBTrACS). Bulletin of the American Meteorological Society, 91(3), Article 3. https://doi.org/10.1175/2009bams2755.1
Examples
# Creating a `stormsDataset` object with storms between 2010 and 2015
# in the South Pacific using the NetCDF provided with the package
SP_2015_2020_nc <- defStormsDataset(seasons = c(2010, 2015))
str(SP_2015_2020_nc)
# Creating a `stormsDataset` object with storms between 2010 and 2015
# in the South Pacific using the CSV provided with the package
fileName <- system.file("extdata", "test_dataset.csv", package = "StormR")
SP_2015_2020_csv <- defStormsDataset(seasons = c(2010, 2021))
str(SP_2015_2020_csv)