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