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