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