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