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