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