library(lubridate) library(ggplot2) library(StreamMetabolism) library(xts) library(reshape) library(scales) Cadzand_Bad_ <- sunrise.set(51.3732708,3.3806895999999824, "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)