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