Skip to content
Snippets Groups Projects

merge a few edits

Merged Ben Anderson requested to merge ba1e12/datacleaning:master into master
6 files
+ 1267
1141
Compare changes
  • Side-by-side
  • Inline
Files
6
+ 27
2
@@ -9,7 +9,7 @@ author: '`r params$authors`'
date: 'Last run at: `r Sys.time()`'
output:
bookdown::html_document2:
self_contained: TRUE
self_contained: no
fig_caption: yes
code_folding: hide
number_sections: yes
@@ -305,13 +305,17 @@ aggDT[, propExpected := sumOK/(uniqueN(feederDT$feeder_ID)*24*4)] # we expect 25
summary(aggDT)
message("How many days have 100%?")
nrow(aggDT[propExpected == 1])
n <- nrow(aggDT[propExpected == 1])
n
```
So, there are `r n` days with 100% data...
If we plot the mean then we will see which days get closest to having a full dataset.
```{r bestDaysMean, fig.width=8}
ggplot2::ggplot(aggDT, aes(x = rDate, colour = season, y = meanOK)) + geom_point()
```
Re-plot by the % of expected if we assume we _should_ have 25 feeders * 24 hours * 4 per hour (will be the same shape):
@@ -319,6 +323,27 @@ Re-plot by the % of expected if we assume we _should_ have 25 feeders * 24 hours
```{r bestDaysProp, fig.width=8}
ggplot2::ggplot(aggDT, aes(x = rDate, colour = season, y = 100*propExpected)) + geom_point() +
labs(y = "%")
aggDT[, rDoW := lubridate::wday(rDate, lab = TRUE)]
h <- head(aggDT[season == "Spring"][order(-propExpected)])
kableExtra::kable(h, caption = "Best Spring days overall",
digits = 3) %>%
kable_styling()
h <- head(aggDT[season == "Summer"][order(-propExpected)])
kableExtra::kable(h, caption = "Best Summer days overall",
digits = 3) %>%
kable_styling()
h <- head(aggDT[season == "Autumn"][order(-propExpected)])
kableExtra::kable(h, caption = "Best Autumn days overall",
digits = 3) %>%
kable_styling()
h <- head(aggDT[season == "Winter"][order(-propExpected)])
kableExtra::kable(h, caption = "Best Winter days overall",
digits = 3) %>%
kable_styling()
```
This also tells us that there is some reason why we get fluctations in the number of data points per hour after 2003.
Loading