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