library(lubridate) library(ggplot2) library(StreamMetabolism) library(xts) library(reshape) library(scales) 52068 <- sunrise.set(42.4106499,-90.810357, "2021/01/01", timezone="MET", num.days=370) sunrise <- 52068$sunrise sunset <- 52068$sunset sunrise <- strftime(sunrise, format="%R", tz="MET") sunset <- strftime(sunset, format="%R", tz="MET") 52068["sr"] <- as.POSIXct(sunrise, format = "%H:%M") 52068["ss"] <- as.POSIXct(sunset, format = "%H:%M") 52068["timestamp"] <- align.time(52068$sunrise, 60*10) 52068 <- 52068[c("timestamp", "sr", "ss")] locsrss <- ggplot(52068, aes(x=52068$timestamp)) + geom_line(aes(y=52068$sr)) + geom_line(aes(y=52068$ss)) + labs(title = " Sonnenauf-/Sonnenuntergang - 52068 2021", x = "Datum", y = "Zeit") pdf("52068_SA_SU.pdf", paper="a4r", width=11) locsrss dev.off() png(filename="52068_SA_SU.png", width = 1400, height = 800, units = "px") locsrss dev.off() 52068["Sonnenaufgang"] <- strftime(52068$sr, format="%H:%M") 52068["Sonnenuntergang"] <- strftime(52068$ss, format="%H:%M") write.table(52068, file="52068_SaSu.csv", dec=',', sep=';', row.names=FALSE)