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