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