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