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