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