R: convert dates from daily to weekly and plotting them
问题 I am trying to learn how to deal with time series data. I created some fake daily data, tried to aggregate it by week and then plot it: set.seed(123) library(xts) library(ggplot2) date_decision_made = seq(as.Date("2014/1/1"), as.Date("2016/1/1"),by="day") date_decision_made <- format(as.Date(date_decision_made), "%Y/%m/%d") property_damages_in_dollars <- rnorm(731,100,10) final_data <- data.frame(date_decision_made, property_damages_in_dollars) y.mon<-aggregate(property_damages_in_dollars