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