Run a t-test and calculate effect sizes (Cohen's D) using effsize

t.test() works with vectors not data frames so I think you might want to use it inside a mutate() function.

If you need more specific help, please provide a proper REPRoducible EXample (reprex) illustrating your issue.