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