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