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