[R] subset svydesign problem

Daniela Droguett daniela.droguett.leon at gmail.com
Wed Jun 3 13:32:00 CEST 2015


Hi,

it seems not possible to susbset a svydesign object (DBI svydesign) and use
variables to make the subset expression


uff<-c("14","15")

for (i in 1:length(uff))
{

subpnad<-subset(pnad, uf==uff[i] & v0302=='4')

}

the error is the following
Error in sqliteSendQuery(con, statement, bind.data) :
  error in statement: no such column: uff

I have tried to use eval to make the expression without sucess, then

for (i in 1:length(uff))
{

expr<-eval(paste0("uf==",uff[i]," & v0302=='4'))

subpnad<-subset(pnad, expr)

}

complains that "no such column: expr" exists.

how to solve that?

Thanks!

	[[alternative HTML version deleted]]



More information about the R-help mailing list