Updated: 2019 June 18

Raw data

test <- read_csv("./data/sample_sensor_data/data007.csv")

test <- test %>% 
  clean_names()

test %>%  
  datatable()
test <- test %>% 
  mutate(ts = mdy_hm(timestamp)) %>% # parse timestamp from charcter string 
  select(-starts_with("x")) # cull the blank columns

Temperature

temp.plotc <- test %>% 
  ggplot() +
  geom_line(aes(x= ts, y = rtc_temp_c_surface)) +
  geom_point(aes(x= ts, y = rtc_temp_c_surface), color = "red") +
  labs(x = "Timestamp", y = "Temperature (C)")

plotly::ggplotly(temp.plotc)

Voltage

volt <- test %>% 
  # filter(voltage<4.59) %>% 
  ggplot() +
  geom_line(aes(x= ts, y = voltage)) +
  geom_point(aes(x= ts, y = voltage)) +
  labs(x = "Timestamp", y = "Voltage")

plotly::ggplotly(volt)

Pressure

test <- test %>%
  mutate(pressure_dif = pressure_1_adjusted -
pressure_2_atmospheric) # calc the diff 

# tidy the data
test.tidy <- test %>%
  gather(key = var, value = val, -c(timestamp, ts, serial_number, voltage, rtc_temp_c_surface, pressure_dif))

pressure.plot <- test.tidy %>% 
  ggplot() +
  geom_line(aes(x = ts, y = val, color = var)) +
  labs(x = "Timestamp", y = "Pressure")

plotly::ggplotly(pressure.plot)

Pressure difference

pdif.plot <- test.tidy %>% 
  ggplot() +
  geom_line(aes(x = ts, y = pressure_dif)) +
  labs(x = "Timestamp", y = "Pressure", title = "Pressure difference between 'pressure_1_adjusted' and 'pressure_2_atmospheric'")

plotly::ggplotly(pdif.plot)