Last active
April 8, 2025 21:38
-
-
Save fernandobarbalho/aa6e6ecc1742900e6145ba7feb5c2f22 to your computer and use it in GitHub Desktop.
Tratamento de arquivo sobre MCMV baixado do ministério das cidades
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Lê o arquivo baixado do portal do MCidades | |
arquivo<- read_file("view_dados_abertos_fgts_agrupado_202411051721.csv") | |
#Remove as aspas duplas | |
arquivo_trabalho <- str_remove_all(arquivo,'"') | |
#Gera um novo arquivo csv | |
write_lines(arquivo_trabalho, "moradias_convertido.csv") | |
#GEra o dataframe | |
library(readr) | |
moradias_convertido <- read_delim("moradias_convertido.csv", | |
delim = "|", escape_double = FALSE, col_types = cols(data_referencia = col_date(format = "%d/%m/%Y")), | |
locale = locale(decimal_mark = ",", grouping_mark = "."), | |
trim_ws = TRUE) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment