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