I have the following data:
x <- 11
w <- "12AAB"
y <- "var1"
I also have a function funky(x,w,y){}
With the above 3 constants as inputs I can apply the following:
funky(x = x, w = w, y = y)
Which imports a bunch of data and performs some calculations and saves the file in a specific folder. I now however want to expand the function over to different "vars" where y is a character vector. For instance;
x <- 11
w <- "12AAB"
y <- c("var1", "va2", "var3")
How can I use lapply
to run the function using x = 11
, w = 12AAB
and firstly run using y = var1
, then secondly y = var2
etc.
I do not have anything specific to apply the function to so I cannot use lapply(data, funky)