Here, we create a sample dataset.

library(dplyr)
library(lubridate)
library(devtools)

Load our data and take a look:

wx_inst <- readRDS("obs_wx_inst.Rds")

glimpse(wx_inst)

We want only from the year 2011, and only these variables:

Apparently, attributes don't sit well with dplyr. There has to be a better way to do this, but I'll do it by hand for now.

wx_2011 <- wx_inst %>%
  select(instant, tmp_db, tmp_wb, rel_humid, p_sl) 

attributes(wx_2011$tmp_db) <- NULL
attributes(wx_2011$tmp_wb) <- NULL
attributes(wx_2011$rel_humid) <- NULL
attributes(wx_2011$p_sl) <- NULL

wx_2011 <- wx_2011 %>%
  filter(year(instant) == 2011)

glimpse(wx_2011)

Now, we have a dataset that we can add to the package:

use_data(wx_2011, pkg = "..", overwrite = TRUE)


ijlyttle/groundTemp documentation built on May 18, 2019, 3:41 a.m.