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