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