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