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