Hi! I have a dataset with some 300+ variables and 2000+ records. I'd like to grind through a bunch of analyses on the variables by using a script, but can't figure out how to refer to variable names properly. For some of the simpler stuff I use various "apply" functions, but for others (like t-tests etc) I need by command procedures. I've tried various flavors of "for(var in names(Dataset)){...}" but this does not work consistently. Actually, "for(var in names(Dataset){print var}, seems to work perfectly, giving a list of variable names, but "for(var in names(Dataset)){mean(var, na.rm=T) or for(var in names(Dataset)){glm(var~var1+var2+var3....} do not.
Any suggestions about how best to go about this? Thanks Jon ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.