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