rstudio - calculating monthly mean time series -
what want compute , plot mean monthly values of time series (which daily streamflow series have plotted, of place in oklahoma city waterdata values, record of 30 years), having x-axis time (monthly) , y-axis streamflow values. report time series plot.
i have got plot daily streamflow values, not being able compute mean monthly values it. don't know going wrong, have been working on hours first time using r, cannot seem calculate mean values.
can please suggest how this?
this current r script finding daily stream flows (which done) , mean monthly values(which cannot work):
finding dailystream flow values
install.packages("waterdata") library(waterdata) water_data<-importdvs("07339000",sdate="1988-03-23",edate="2017-09-03") filled<-fillmiss(dataset = water_data) legend(6000, 25000, c(paste("mean=",round(mean(water_data$val),digits=2)),paste("sd=",round(sd(water_data$val),digits=2))))
this part of code runs!
finding monthly mean values of time series
dates <- data.frame(date = as.date("water_data$dates", format = "%y-%m-%d")) monthlymean <- aggregate(x = "water_data$val",by = list(month = substr(water_data$val, 1, 7)),fun = mean) plot(x = monthlymean$val,y = water_data$dates)
this part not run!
please me this, think not being able frame aggregate function not giving plot values correctly.
Comments
Post a Comment