running function on different dataframe and with different outcome

See the FAQ: How to do a minimal reproducible example reprex for beginners to include what's needed for a testable answer.

In outline, long variable names are useful only when dealing with a multitude of objects. In a short script with a handful, use short names with explanatory comments. Refactor the equation to derive the log version within the function, rather than the data frame. This cuts down on the number of parameters required in the function.

This is only a sketch, not tested.

# shorten names

# data frames
dragons
others

cms <- function(x) do_something(x)

# if the log_variable in the data frame is 
# just the log of the variable, do it in
# the function: cms(x) where cms() will
# run a model on x and log(x)

happy <- "happy"
agililty <- "agility"

# these return a list with the two models
# not checked, for lack of data
dmh <- mapply(happy,cms)
dma <- mapply(agility,cms)
amh <- mapply(happy,cms)
ama <- mapply(agility,cms)