Local Weather Data

Author

Nathan Craig

Published

July 18, 2023

Abstract

Read local weather data with a longer term aim towards correlating these data with environmental data logged inside the museum.

Local Temperature

First call the necessary libraries.

# Knitr options
knitr::opts_chunk$set(
  echo = FALSE,
  message = FALSE,
  warning = FALSE
  )


library(dplyr)
library(riem)
library(xts)
library(dygraphs)

Then request data and evaluate results (Table 1).

Table 1:

The first rows of station LRU

To use the dygraphs library, convert the data to a time series. Here, I use xts to create time series objects for temperature and relative humidity which are variables recorded inside at the museum. Then we take the two time series and cbind them into a single object.

This is then displayed by calling the dygraph function and applying minimal styling arguments.

Figure 1: Graph showing temperature and relative humidity for the LRU

Logged Data

     [,1] [,2]
                    las_cruces_temperature ts_list.base_temp
2020-01-01 00:15:00                   44.8                NA
2020-01-01 00:35:00                   41.7                NA
2020-01-01 00:55:00                   39.6                NA
2020-01-01 01:15:00                   36.9                NA
2020-01-01 01:35:00                   38.1                NA
2020-01-01 01:55:00                   37.0                NA

Citation

BibTeX citation:
@online{craig2023,
  author = {Craig, Nathan},
  title = {Local {Weather} {Data}},
  date = {2023-07-18},
  url = {https://um-environment.netlify.app/projects/2023-07-18-local-weather},
  langid = {en},
  abstract = {Read local weather data with a longer term aim towards
    correlating these data with environmental data logged inside the
    museum.}
}
For attribution, please cite this work as:
Craig, Nathan. 2023. “Local Weather Data.” July 18, 2023. https://um-environment.netlify.app/projects/2023-07-18-local-weather.