datawookie / trundler
Showing 1 of 3 files from the diff.
Other files ignored by Codecov

@@ -28,7 +28,12 @@
Loading
28 28
  }
29 29
30 30
  df <- product_prices(product_id) %>%
31 -
    mutate(date = as.Date(time))
31 +
    mutate(date = as.Date(time)) %>%
32 +
    # Consolidate prices where there are multiple prices per date (unusual, but it happens).
33 +
    group_by(date) %>%
34 +
    mutate(price = mean(price)) %>%
35 +
    slice(1) %>%
36 +
    ungroup()
32 37
33 38
  if (is.null(date_min)) {
34 39
    date_min <- min(df$date)
@@ -40,9 +45,12 @@
Loading
40 45
41 46
  dates <- seq.Date(date_min, date_max, by = "day")
42 47
48 +
  # Only interpolate prices for the relevant time period
43 49
  df <- complete(df, date = dates, nesting(product_id)) %>%
44 50
    group_by(product_id) %>%
45 -
    mutate(price = approx(date, price, date, method = "constant", rule = 2)$y)
51 +
    mutate(price = approx(date, price, date, method = "constant", rule = 2)$y) %>%
52 +
    # Remove prices that weren't interpolated and that fall outside the relevant time period
53 +
    filter(date %in% dates)
46 54
47 55
  df <- df %>%
48 56
    mutate(is_interpolated = ifelse(is.na(time), TRUE, FALSE)) %>%
Files Coverage
R 80.93%
Project Totals (11 files) 80.93%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading