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