Need helping creating a loop in R. Have many similarly named variables I have to apply the same func
- by user335897
I am using a dataset w/variables that have very similar names. I have to apply the same functions to 13 variables at a time and I'm trying to shorten the code, instead of doing each variable individually.
q01a.F=factor(q01a)
q01b.F=factor(q01b)
q01c.F=factor(q01c)
q01d.F=factor(q01d)
q01e.F=factor(q01e)
q01f.F=factor(q01f)
q01g.F=factor(q01g)
q01h.F=factor(q01h)
q01i.F=factor(q01i)
q01j.F=factor(q01j)
q01k.F=factor(q01k)
q01l.F=factor(q01l)
q01m.F=factor(q01m)
Suggestions?