0
I’m willing to apply the same condition subset
on different bases in the R.
I thought the for
was going to solve, but I did not succeed.
Follows programming used:
for(i in c("mar16", "jun16", "set16", "dez16", "mar17")){
postos[i]<-subset(postos[i],postos[i]$SEGMENTO=="Bancos")
}
Can you use the for
for this type of situation?
it would be interesting for you to provide a part of your database to reproduce your code.
– Rafael Cunha
It’s possible, but there are lower cost ways to do what you need. I believe your code has two errors, the first is to save on the same basis (the first
postos[i]
), the second is what is causing you more problems, does not have the[i]
at lastpostos
. Note that your possible result is a single-column dataframe.– Daniel Ikenaga