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