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