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