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