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