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