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