create_wildfire: Create US wildfires dataframe from the Kaggle US Wildfire...

Description Usage Arguments Value Note Examples

View source: R/prep_wildfire.R

Description

Create US wildfires dataframe from the Kaggle US Wildfire SQLite db

Usage

1
2
3
4
5
6
7
8
create_wildfire(
  db_name,
  state_abbrev = NULL,
  cols = c("FIRE_NAME", "DISCOVERY_DATE", "CONT_DATE", "STAT_CAUSE_DESCR", "FIRE_SIZE",
    "FIRE_SIZE_CLASS", "LATITUDE", "LONGITUDE", "STATE", "FIPS_CODE", "FIPS_NAME"),
  year_min = 1992,
  year_max = 2015
)

Arguments

db_name

File path of the SQLite wildfire database.

state_abbrev

Abbreviations of the states to retrieve the wildfire data for.

cols

Columns to select from the wildfire database. For more info: (https://www.kaggle.com/rtatman/188-million-us-wildfires)

year_min

earliest year to pull the air quality data for, starts January 1st.

year_max

latest year to pull the air quality data for, ends December 31st.

Value

A dataframe of wildfires that occurred in the United States.

Note

The function relies on the SQLite db available on Kaggle: (https://www.kaggle.com/rtatman/188-million-us-wildfires) Unfortunately, Kaggle API does not support R at this time. Download the '188-million-us-wildfires.zip' file, and provide the path to the function as db_name, i.e. db_name = 'data-raw/FPA_FOD_20170508.sqlite'

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## Not run: 
fires <- create_wildfire(db_name = 'data-raw/FPA_FOD_20170508.sqlite',
                         state_abbrev = c('CA', 'NY'),
                         cols=c('FIRE_NAME', 'DISCOVERY_DATE', 'CONT_DATE',
                                'STAT_CAUSE_DESCR', 'FIRE_SIZE', 'FIRE_SIZE_CLASS',
                                'LATITUDE', 'LONGITUDE', 'STATE', 'FIPS_CODE', 'FIPS_NAME'),
                         year_min = 1992,
                         year_max = 2015)

## End(Not run)

wildviz documentation built on Aug. 23, 2021, 9:06 a.m.