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