knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

addNarrData

R build status R-CMD-check

The goal of addNarrData is to add average NARR weather varaibles to data based on narr_cell (an identifier for a 12 x 12 km NARR grid cell) and start_date and end_date.

NARR Data Dictionary

| Variable Name | Description| | :-- | :-- | | hpbl | Planetary Boundary Layer Height | | vis | Visibility | | uwnd.10m | U Wind Speed at 10m | | vwnd.10m | V Wind Speed at 10m | | air.2m | Air Temperature at 2m | | rhum.2m | Humidity at 2m | | prate | Precipitation Rate | | pres.sfc | Surface Pressure |

More information is available at the NOAA website.

Installation

Install from GitHub with:

# install.packages("remotes")
remotes::install_github("geomarker-io/addNarrData")

Example Usage

add NARR data.

library(addNarrData)
library(magrittr)

d <- tibble::tibble(
  id = c('1a', '2b', '3c'),
  visit_date = c("3/8/17", "2/6/12", "6/18/20"),
  lat = c(39.19674, 39.19674, 39.48765),
  lon = c(-84.582601, -84.582601, -84.610173)
)

d %>%
  dplyr::mutate(
    visit_date = as.Date(visit_date, format = "%m/%d/%y"),
    start_date = visit_date - lubridate::days(7), # weekly average
    end_date = visit_date
    ) %>%
  get_narr_data(narr_variables = c("air.2m", "rhum.2m"))

NARR data files

The package works by downloading chunks of NARR data automagically. These are stored in an Amazon s3 drive at

s3://geomarker/narr/narr_chunk_fst/narr_chunk_{number}_{variable}.fst

where {number} is replaced with the NARR chunk number (0 - 9), and {variable} is replaced with one of the available NARR variables (hpbl, vis, rhum.2m, prate, air.2m, pres.sfc, uwnd.10m, vwnd.10m). Each file is about 350 MB in size, but only the files needed will be downloaded.

More information on the NARR fst chunk files can be found at narr_raster_to_fst.



geomarker-io/addNarrData documentation built on July 18, 2021, 4:02 a.m.