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