Skip to content

Data Preparation

Zhan, Jennifer edited this page Dec 17, 2020 · 6 revisions

Preparation of rpi_wap_raw.rds and combined_wap_data.rds

These two files are the main data frames used in the SafeCampus app. They are created in Test_WiFi_overview_source.R and then converted into Rds files to improve the speed and flow of the app. They are both created from rpi_wifi_last_seven_days.Rds. Below is a step by step guide to the creation of these data frames in Test_WiFi_overview_source.R:

  1. Format the time and date columns to Eastern Standard Time (EST).
  2. Merge with apinfo.csv and allBuildingInfo.csv to add specific building and WAP device information to the data frame.
  3. Add the 30 minute time intervals to the data frame using Min_25_24_time.csv.
  4. The combined_wap_data data frame stems from rpi_wap_raw and takes the sum of user count and mac count for every 30-minute interval.
  5. Finally, Rds files are created of the rpi_wap_raw and combined_wap_data data frames used in the SafeCampus app.

Interval Data vs Continuous Data

Due to the nature of how the WAP data are collected, they are in discrete samples. Later data processing grouped them into 30-minutes intervals, which are used in the Campus WiFi Overview and Campus WiFi Dashboard tab. Considering that time is a continuous variable, the Detailed WiFi Overview takes this into account by representing the data through using the data in each exact time instead of grouping them into 30-minutes intervals. While making the lineplot using ggplot to show the data, we are able to view the continuous changing of user count or device count in each access point. Using both the interval data and continuous data, users could easily switch between tabs and get both the time range and the specific time of each hotspot throughout the campus.