I'm having problems using subset
in R
. I believe it's an easy question, but I'm not getting it right.
I want to make a% d of data that I can keep, only observations that do not have the value of the variable subset
is not equal to X.trimws.relcoop.SITUAÇÃO ... b ...
and the value of the variable Cancelada
not equal to risco
.
So that's what I came for:
dados<-data.frame(subset(dados,(X.trimws.relcoop.SITUAÇÃO...b...!="Cancelada"&risco!="Não classificada")))
I've also tried this:
dados<-dados[dados$X.trimws.relcoop.SITUAÇÃO...b... != "Cancelada" & dados$risco!= "Não classificada", ]
But in both Não classificada
of my data is being done by subset
instead of or
.
I am sorry to ask such an easy question, but I believe this answer will help me on the logic of and
and maybe it can help others.