sidrar icon indicating copy to clipboard operation
sidrar copied to clipboard

geo.filter for MT state not working

Open dvictori opened this issue 4 years ago • 1 comments

Trying to get municipal soy planted area for a specific state. If I filter for MS state (geo.filter('State' = 50) it works. But for MT state (geo.filter('State' = 51), some other data comes in.

My test code:

library(sidrar)

# getting soy planted area for municipalities in MS state
dados <- get_sidra(1612,
                   variable = c(109),
                   geo = 'City',
                   geo.filter = list("State" = 50),
                   classific = 'c81',
                   category = list('2713'))

uf <- sapply(strsplit(dados$Município, " - "), function (x) x[2])
table(uf)

# uf
# MS 
# 79 

# now getting soy planted area for municipalities in MT state
dados <- get_sidra(1612,
                   variable = c(109),
                   geo = 'City',
                   geo.filter = list("State" = 51),
                   classific = 'c81',
                   category = list('2713'))

uf <- sapply(strsplit(dados$Município, " - "), function (x) x[2])
# data from MS and RO in the response
table(uf)

# uf
# MS  MT  RO 
# 55 141   1 

dvictori avatar Apr 09 '20 14:04 dvictori