I am scratching my head over this, ive created a new column and would like to filter the J.D column based on that new column.
df %>%
filter(Year >= 1920, Year < 2019) %>%
select(Year,J.D) %>%
mutate(cutoff = ifelse(Year < 1970,1,0)) %>%
t.test(x = df[cutoff == 0][J.D], y = df[cutoff == 1][J.D] )