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