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