Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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