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