I have two data frames: Conc and Flow.
Flow has a value for each day for a given period, while Conc has only a specific value on certain days for a period of a period.
What I want to do is to calculate the average flow rates for each period between Conc values using r.
The following code generates two sample data to illustrate the types of data sets that I work with:
Conc <- data.frame(Date = as.Date(c("2012/01/13", "2012/02/16", "2012/05/02", "2012/07/28",
"2012/11/10")), Conc = c(0.88, 0.55, 0.34, 0.21, 0.98))
Flow <- data.frame(Date = c(seq(as.Date("2012/01/01"), by = "day", length.out = 365)),
Flow = c(sample(seq(from = 0.01, to = 5, by = 0.1), size = 365, replace = TRUE)))
The original data frame should ideally look something like this:
Period Mean_Flow
1 2.01
2 1.41
3 3.81
4 0.31
, Conc days . , , - Excel, R, , 10 , .
.