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