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