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