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