rm(list=ls(all=TRUE))
suppressMessages(library(tidyverse))
oldwd <- getwd()
setwd("C:/Users/Eric.Krantz/Dropbox (Personal)/Luke")
ReadCampbell <- function(filename){
columnnames <- as.character(unlist(read.csv(filename, nrow=1, skip = 1, header = FALSE)))
dat <- read.csv(filename, skip=4, header = FALSE)
names(dat) <- columnnames
dat$TIMESTAMP <- as.POSIXct(dat$TIMESTAMP)
return(dat)
}
floatdat <- ReadCampbell("Luke2.dat")
alldat <- gather(floatdat,key="Variable", value = "Value", -TIMESTAMP)
for (i in unique(alldat$Variable)){
x <- filter(alldat,alldat$Variable==i)
myplot <- ggplot(x, aes_string(x = "TIMESTAMP", y = "Value")) +
geom_line() +
xlab("") +
ylab(x[1,2]) +
scale_x_datetime(date_minor_breaks = "day")
print(myplot)
}
Zoom in to the strange data after December 1
alldat <- filter(alldat, TIMESTAMP > "2017-12-01 00:00:01")
for (i in unique(alldat$Variable)){
x <- filter(alldat,alldat$Variable==i)
myplot <- ggplot(x, aes_string(x = "TIMESTAMP", y = "Value")) +
geom_line() +
xlab("") +
ylab(x[1,2]) +
scale_x_datetime(date_minor_breaks = "day")
print(myplot)
}