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