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