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