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