R/aaa.R

set_names <- function (object = nm, nm) {
  names(object) <- nm
  object
}

# we need these to translate day & *_hr to the param the app needs
c(
  "0100", "0112", "0200", "0212", "0300", "0312", "0400", "0412",
  "0500", "0512", "0600", "0612", "0700", "0712", "0800", "0812",
  "0900", "0912", "1000", "1012", "1100", "1112", "1200", "1212",
  "1300", "1312", "1400", "1412", "1500", "1512", "1600", "1612",
  "1700", "1712", "1800", "1812", "1900", "1912", "2000", "2012",
  "2100", "2112", "2200", "2212", "2300", "2312", "2400", "2412",
  "2500", "2512", "2600", "2612", "2700", "2712", "2800", "2812",
  "2900", "2912", "3000", "3012", "3100", "3112"
) -> hr_vals

c(
  "01/00Z", "01/12Z", "02/00Z", "02/12Z", "03/00Z", "03/12Z", "04/00Z",
  "04/12Z", "05/00Z", "05/12Z", "06/00Z", "06/12Z", "07/00Z", "07/12Z",
  "08/00Z", "08/12Z", "09/00Z", "09/12Z", "10/00Z", "10/12Z", "11/00Z",
  "11/12Z", "12/00Z", "12/12Z", "13/00Z", "13/12Z", "14/00Z", "14/12Z",
  "15/00Z", "15/12Z", "16/00Z", "16/12Z", "17/00Z", "17/12Z", "18/00Z",
  "18/12Z", "19/00Z", "19/12Z", "20/00Z", "20/12Z", "21/00Z", "21/12Z",
  "22/00Z", "22/12Z", "23/00Z", "23/12Z", "24/00Z", "24/12Z", "25/00Z",
  "25/12Z", "26/00Z", "26/12Z", "27/00Z", "27/12Z", "28/00Z", "28/12Z",
  "29/00Z", "29/12Z", "30/00Z", "30/12Z", "31/00Z", "31/12Z"
) -> hr_inputs

hr_trans <- set_names(hr_vals, hr_inputs)
hrbrmstr/unsound documentation built on May 20, 2019, 5:42 p.m.