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