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