I want to create new dataframes by extracting each column from the base dataframe data_model
applying the split
function and saving each new transformed variable in a new dataframe.
I have applied the following code:
for (i in c("l_inf","l_tax","l_fd","l_gdp")) {
new_df <- paste0("df_",i)
new_df <- data.frame(split(data_model$paste0(i),data_model$code,drop = TRUE))
}
it returns the following error to me:
Error in data_modelo$paste0(i) : attempt to apply non-function
help me!!