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