df_mean1 <- df_mean %>%
gather(key = "sensor", value = "value", -TIMESTAMP) %>%
as.tibble() %>%
mutate(camPlane = substring(sensor, 1, 4),
target = substring(sensor, 5, nchar(sensor)))
# group_by(camPlane)
#df_sd <- gather(df_sd, key = "sensor", value = "value", -TIMESTAMP) %>% as.tibble()
#df_isNA <- gather(df_isNA, key = "sensor", value = "value", -TIMESTAMP) %>% as.tibble()
myplot <- ggplot(df_mean1) +
geom_line(aes(x=TIMESTAMP, y = value, color = sensor)) +
ylim(c(-1, 1)) +
xlab("") +
theme(legend.title = element_blank())
loopvals <- unique(df_mean1$camPlane)
for (i in 1:length(loopvals)){
print(myplot %+% subset(df_mean1, camPlane %in% loopvals[i]) +
labs(title = paste0(loopvals[i], " Mean (inches)")) +
theme(plot.title = element_text(hjust = 0.5))
)
}





























