Created
March 14, 2021 19:26
-
-
Save tejseth/9ee74101128c0ef7aa2f6a6fd0ec3323 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| library(tidyverse) | |
| library(dplyr) | |
| library(na.tools) | |
| library(ggimage) | |
| library(hrbrthemes) | |
| library(viridis) | |
| theme_tej <- function() { | |
| theme(text = element_text(family='Tahoma', color="#232D4B"), # set font and color of all text | |
| plot.title = element_text(size = 20, hjust = 0.5, face = "bold"), | |
| plot.subtitle = element_text(size = 12, hjust = 0.5), | |
| legend.position = "none", | |
| axis.title = element_text(size = 14), | |
| axis.text = element_text(size = 12)) | |
| } | |
| electrical1 <- read.csv("~/Downloads/electrical1.csv") | |
| electrical2 <- read.csv("~/Downloads/electrical2.csv") | |
| electrical3 <- read.csv("~/Downloads/electrical3.csv") | |
| electrical1 <- electrical1 %>% | |
| filter(!is.na(electrical1$TS)) | |
| electrical1 <- electrical1 %>% | |
| filter(TS != "") | |
| electrical1 <- electrical1 %>% | |
| separate(TS, c('date', 'time', "am_or_pm"), sep=" ") | |
| electrical1$day_of_week <- weekdays(as.Date(electrical1$date)) | |
| colnames(electrical1)[which(names(electrical1) == "day_of_week")] <- "Day.of.Week" | |
| elctrical1_stats <- electrical1 %>% | |
| filter(!is.na(date)) %>% | |
| group_by(date, Key) %>% | |
| summarize(count = n(), | |
| min_value = min(Value), | |
| mean_value = mean(Value), | |
| max_value = max(Value)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment