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