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