microsoft / datamations

https://microsoft.github.io/datamations/
Other
67 stars 14 forks source link

Remove warnings #19

Closed sharlagelfand closed 3 years ago

sharlagelfand commented 3 years ago

Removed warnings as described in #15, the code there no longer produces warnings. Closes #15.

Replaced depricated funs with list to handle these warnings:

4: `funs()` was deprecated in dplyr 0.8.0.
Please use a list of either functions or lambdas: 

  # Simple named list: 
  list(mean = mean, median = median)

  # Auto named with `tibble::lst()`: 
  tibble::lst(mean, median)

  # Using lambdas
  list(~ mean(., trim = .2), ~ median(., na.rm = TRUE))
This warning is displayed once every 8 hours.
Call `lifecycle::last_warnings()` to see where this warning was generated. 

The other change is replacing code that generates limits (which are then tweened) as a data frame instead of as a tibble - the tibble case produces warnings when tweened, but the data.frame case does not - not 100% sure why, just an oddity of the format, I guess! The tweening is what produces those .id and .frame columns and we can use them no problem. These warnings are gone now:

5: Unknown or uninitialised column: `.id`. 
6: Unknown or uninitialised column: `.frame`. 
7: Unknown or uninitialised column: `.id`. 
8: Unknown or uninitialised column: `.id`. 

And I've added a test to the new function to ensure the results are equivalent to the old tibble case.

This is branched off the gh-actions branch in an attempt to avoid the need to fix a bunch of merge conflicts later (since the gh-actions branch contains a bunch of cleaned/styled code, but main does not) - so only the last few commits are relevant, but once that's merged I'll rebase to main and we can merge just these new ones in.