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