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