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