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