rfsaldanha / microdatasus

Download de dados do DataSUS e pré-processamento no R.
https://rfsaldanha.github.io/microdatasus/
Other
221 stars 54 forks source link

Erro com process_cnes. Alguém pode ajudar? #116

Open migdep opened 2 months ago

migdep commented 2 months ago

Boa tarde!

Baixei os dados de CNES-ST de um mês de 2008 com sucesso com o seguinte script:

dados_CNES_2008 <- fetch_datasus(year_start = 2008, month_start = 6, year_end = 2008, month_end = 6, uf = "all", information_system = "CNES-ST")

Porém quando quero processá-los, com process_cnes, aparece estes erros:

CNES_2008_Proces <- process_cnes(dados_CNES_2008) _Error in process_cnes(dados_CNES_2008) : Assertion on 'informationsystem' failed: Must be element of set {'CNES-ST','CNES-PF'}, but is not atomic scalar. In addition: Warning messages: 1: In if (match < 0) { : the condition has length > 1 and only the first element will be used 2: In if (match < 0) { : the condition has length > 1 and only the first element will be used 3: In if (match < 0) { : the condition has length > 1 and only the first element will be used 4: In if (match < 0) { : the condition has length > 1 and only the first element will be used 5: In if (match < 0) { : the condition has length > 1 and only the first element will be used 6: In if (match < 0) { : the condition has length > 1 and only the first element will be used 7: In if (match < 0) { : the condition has length > 1 and only the first element will be used

Como proceder?

migdep commented 2 months ago

Também testei com outro script, mas apareceu outra mensagem de erro: process_cnes(dados_CNES_2008, information_system = c("CNES-ST"), nomes = TRUE, municipality_data = TRUE) Error in eval(jsub, SDenv, parent.frame()) : invalid multibyte string at ''

rfsaldanha commented 1 month ago

Olá! Obrigado por avisar sobre o problema. Alguns arquivos do DataSUS tem problemas de codificação e eu tenho sofrido para conseguir lidar com isso no pacote. Vou procurar melhorar essa questão até a próxima versão do pacote.