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