2
I’m having trouble using subset in R. I believe it’s an easy question, but I’m not getting it right.
I want to make a subset of data that I can keep, only observations that do not have the value of the variable X.trimws.relcoop.SITUAÇÃO ... b ... is not equal to Cancelada and the value of the variable risco not equal to Não classificada.
So that’s what I came for:
dados<-data.frame(subset(dados,(X.trimws.relcoop.SITUAÇÃO...b...!="Cancelada"&risco!="Não classificada")))
I tried that too:
dados<-dados[dados$X.trimws.relcoop.SITUAÇÃO...b... != "Cancelada" & dados$risco!= "Não classificada", ]
But in both the subset of my data is being made by or instead of and.
I’m sorry to ask such an easy question, but I believe this answer will help me on the logic of R and maybe you can help others.
Very good! Silly mine. It worked. Thank you!
– T. Veiga
Cool, if it worked you can accept the answer, as shows the link
– Daniel Falbel