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