@g-grothendieck BINGO! That solves my problem-- your first solution. I just note that the use of . in arguments requires using the %>% form of pipes, not |>
.
%>%
|>