I have a data set consist of the average value from particular date. Please see the example of dataset below:
structure(list(startdate = structure(c(14951, 14958, 14965, 14978,
14985, 14992), class = "Date"), enddate = structure(c(14957,
14964, 14971, 14985, 14992, 14999), class = "Date"), Conc = c(5.873,
14.591, 8.854, NA, 20.228, 74.57)), row.names = c(NA, -6L), class = c("tbl_df",
"tbl", "data.frame"))
I want to produce new data set consist of daily data based on above dataset. Please see the new dataset I desired below:
structure(list(Date = structure(c(14951, 14952, 14953, 14954,
14955, 14956, 14957, 14958, 14959, 14960, 14961, 14962, 14963,
14964, 14965, 14966, 14967, 14968, 14969, 14970, 14971, 14972,
14973, 14974, 14975, 14976, 14977, 14978, 14979, 14980, 14981,
14982, 14983, 14984, 14985, 14986, 14987, 14988, 14989, 14990,
14991, 14992, 14993, 14994, 14995, 14996, 14997, 14998), class = "Date"),
Conc = c(5.873, 5.873, 5.873, 5.873, 5.873, 5.873, 5.873,
14.591, 14.591, 14.591, 14.591, 14.591, 14.591, 14.591, 8.854,
8.854, 8.854, 8.854, 8.854, 8.854, 8.854, NA, NA, NA, NA,
NA, NA, NA, NA, NA, NA, NA, NA, NA, 20.228, 20.228, 20.228,
20.228, 20.228, 20.228, 20.228, 74.57, 74.57, 74.57, 74.57,
74.57, 74.57, 74.57)), row.names = c(NA, -48L), class = c("tbl_df",
"tbl", "data.frame"))
I can do the opposite (calculate the average value from particular date), but I don't have any idea how to do the opposite. I have a big data set and if I can do this, it will save my life. Please anyone can help me? Thank you in advance.