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