tidystats icon indicating copy to clipboard operation
tidystats copied to clipboard

add_stats results optionally assigned to parent frame

Open gasparl opened this issue 2 years ago • 1 comments

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.

gasparl avatar Apr 16 '22 07:04 gasparl

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)

WillemSleegers avatar Apr 19 '22 08:04 WillemSleegers