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