Hi smart people of the interwebz!
I've got a probably stupid problem. I'm working with a list - called "groups" - of data frames, which I want to work through a function with multiple entry possibilities.
Now the thing is, that although all values should be changeable, but I currently intent to just change one (the data frame) via a list with lapply.
The function looks as follows:
regressions <- function(endo, dataframe, scaling, factorizing){...}
Where I only intent to change the value "Arab_World" (the data frame).
regressions("Ins_Share", Arab_World, T, F)
I tried it with "bullshit bingo" via lapply, but don't know how to input my function into it... I wnat to have the possibility to change values in the function (i.e. endo, scaling and factorizing) in the future, but currently only need to work through the list of data frames.
My last sad try looked something like this, where "x" should be an entry from the list.
lapply(groups, function(x) {regressions("Ins_Share", x, T, F)})
This then produces this error message
Error in colMeans(x, na.rm = TRUE) : 'x' must be numeric Called from: colMeans(x, na.rm = TRUE)
I'm quite frustrated due to the apparent simplicity of the problem, but my inability to solve it, and hope that I could learn from someone in here!
Thank you in advance!