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