I have a data frame that looks like this. names and number of columns will NOT be consistent (sometimes \'C\' will not be present, other times \"D\', \'E\', \'F\' may be pre
As written in the comment: ?as.formula() is one solution. You could do sthg like:
?as.formula()
model = list() for(char in names(YABC)[-1]) { model[[char]] <- lm(as.formula(paste("Y ~ ", char)), YABC) } model