Re: [R] generate list of variable names

2010-06-09 Thread Jon Erik Ween
Thanks Erik I can't figure out how to use the various x_apply functions in this setting, nor post datasets to reproduce. But anyhow: the table structure is something like this: id (integer), handedness(R,L,A), gender(M,F), cat1(patient, control). cat2(stroke, MS, dement, control), accuracy(int

Re: [R] generate list of variable names

2010-06-09 Thread Erik Iverson
Jon Erik Ween wrote: Hi! Would anyone know how to generate a list of variable names from a data frame by the class of the variable? a start... df <- data.frame(f1 = factor(1:10), f2 = factor(1:10), n1 = 1:10, n2 = 1:10) sapply(df, class)

[R] generate list of variable names

2010-06-09 Thread Jon Erik Ween
Hi! Would anyone know how to generate a list of variable names from a data frame by the class of the variable? I have large tables with different numbers of columns and am trying to script some rote analyses. There are several categorizing variables (factors) and many response variables (inte