library(lubridate) library(ggplot2) library(StreamMetabolism) library(xts) library(reshape) library(scales) Egmond <- sunrise.set(52.6186114,4.63024310000003, "2024/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 2024", 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)