I am importing several hundred text files where I need to clean the column names.
t1 <- data.frame("A")
t2 <- data.frame(2)
names(t1) <- "COL one"
names(t2) <- "Col two"
I could do it coercing into a list and lapplying, but I subsequently need to join the dataframes and would prefer to not join on the list.
f <- list(t1=t1,t2=t2)
f2 <- lapply(f,janitor::clean_names)
- is there a method I can use to loop over dataframes, apply a function and return individual data.frames?
- Can I somehow coerce the f2 list back into dataframe t1 and t2?