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