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