Filtering a dataframe in a loop and apply a function or applying a function on each element of a dataframe (?)

It is unfortunately not clear yet, to me.
If you would like someone to help, make the representative example clearer.
If you haven't read what a reprex looks like, please go throuth this excellent explanation and use the reprex package to explain your code.