tidystats
tidystats copied to clipboard
add_stats results optionally assigned to parent frame
There could be an option to assign the given results
output automatically to the parent frame.
...so that instead of
my_results = add_stats(my_results, my_t_test)
... one can just write
add_stats(my_results, my_t_test, assign_results = TRUE)
But the outcome could still be returned invisibly, so that either notation can be used in any case.
Your suggestion, with the argument, ends up being longer than the original line, so I'm not sure it's worth it.
Also note that if you want to store multiple analyses, you can use piping to prevent having to repeat specifying the data frame:
my_results <- my_results %>%
add_stats(my_t_test) %>%
add_stats(my_correlation) %>%
add_stats(my_lm)