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