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