Reputation: 2743
In this:
y <- svytable(~date4a, design = Pew.w)
date4a
is a column name.
I want to replace date4a
with a variable. The variable of course, will refer to a column name.
E.g. something like:
col <- "date4a"
y <- svytable(~col, design = Pew.w) #This doesnt' work
How may I do that?
Upvotes: 1
Views: 76
Reputation: 11903
Under the assumption that this is something that is really worth doing, you could try:
col <- my.data.frame$date4a
y <- svytable(~col, design=Pew.w)
Upvotes: 2