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