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