Multiple Variable Values to Function and Cbind Results
问题 This is a continuation of this question here: For-Loop By Columns with existing For-loop by Rows I have a dataset in which I am using 3 variables: adstock_rate , diminishing_rate , and lag_number . These are currently set to only 1 number each. Currently I am using the following numbers: adstock_rate<-0.5 lag_number<-1 diminishing_rate<-0.6 The final output is a dataset with new columns attached to the existing dataset using the function below. foo1 <- function(dot, lag_val = 1) { tmp <- dot