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