-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
72 additions
and
47 deletions.
There are no files selected for viewing
This file contains 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
File renamed without changes.
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,110 +1,112 @@ | ||
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
###### 0.1.6 Limpeza e Geocode dados da RAIS | ||
# Esse script aplica funcoes que foram definidas na pasta R/fun/empregos p/ todos os anos de processamento | ||
# Sao as funcoes principais: | ||
# 0) Save raw data with columns we use in the municipalities of the project | ||
# 1) Filter raw workers data - only private jobs | ||
# 2) Categorizar trabalhadores por grau de instrucao | ||
# 3) Tratar os outliers | ||
# 4) Trazer o geocode dos estabelecimentos e aprimorar a qualidade quando necessario | ||
# 5) Trazer geocode p/ a base original (da etapa 2) | ||
# 6) Selecionar somente as obsservacoes com boa qualidade de geocode | ||
|
||
# carregar bibliotecas | ||
source('./R/fun/setup.R') | ||
|
||
# carregar funcoes | ||
purrr::walk(dir('./R/fun/empregos', full.names = TRUE), source) | ||
|
||
|
||
|
||
|
||
# Aplicar funcoes para o ano de 2017 ------------- | ||
|
||
# 0) Save raw data with columns we use in the municipalities of the project | ||
rais_filter_raw_data(2017) | ||
|
||
# 0.1) Filter raw workers data | ||
# 1) Filter raw workers data - only private jobs | ||
rais_filter_pessoas(2017) | ||
|
||
# 1) Categorizar trabalhadores por grau de instrucao | ||
# 2) Categorizar trabalhadores por grau de instrucao | ||
rais_categorize_inst(2017) | ||
|
||
# 2) Tratar os outliers | ||
# 3) Tratar os outliers | ||
rais_treat_outliers(2017) | ||
|
||
# 3) Realizar e trazer geocode dos estabelecimentos | ||
# realizar geocode | ||
# rais_clean_estabs_raw(2017) | ||
# rais_export_data_to_galileo(2017) | ||
|
||
## Run Galileo to geocode the data before moving on to the next functions | ||
# 4) Aprimorar o geocode dos estabelecimentos que veio do streetmap | ||
# primeiro, limpar a base completa geocoded que veio do streetmap | ||
rais_clean_estabs_raw(2017) | ||
# segundo, aprimorar o geocde utilizando o geocode do gmaps | ||
rais_gmaps_geocode(2017, run_gmaps = FALSE) | ||
|
||
# rais_check_new_estabs(2017) | ||
# rais_gmaps_geocode(2017, run_gmaps = FALSE) | ||
# trazer geocode | ||
# 5) Trazer geocode p/ a base original (da etapa 2) | ||
rais_bring_geocode(2017) | ||
|
||
|
||
# 5) Selecionar somente as obsservacoes com boa qualidade de geocode | ||
# 6) Selecionar somente as obsservacoes com boa qualidade de geocode | ||
source("R/fun/filter_geocode.R") | ||
geocode_filter(ano = 2017, "rais") | ||
|
||
|
||
|
||
|
||
# Aplicar funcoes para o ano de 2018 ------------- | ||
|
||
# 0) Save raw data with columns we use | ||
# 0) Save raw data with columns we use in the municipalities of the project | ||
rais_filter_raw_data(2018) | ||
|
||
# 0.1) Filter raw trabalhadores data | ||
# 1) Filter raw workers data - only private jobs | ||
rais_filter_pessoas(2018) | ||
|
||
# 1) Categorizar trabalhadores por grau de instrucao | ||
# 2) Categorizar trabalhadores por grau de instrucao | ||
rais_categorize_inst(2018) | ||
|
||
# 2) Tratar os outliers | ||
# 3) Tratar os outliers | ||
rais_treat_outliers(2018) | ||
|
||
# 3) Realizar e trazer geocode dos estabelecimentos | ||
# realizar geocode | ||
# 4) Aprimorar o geocode dos estabelecimentos que veio do streetmap | ||
# primeiro, limpar a base completa geocoded que veio do streetmap | ||
rais_clean_estabs_raw(2018) | ||
rais_export_data_to_galileo(2018) | ||
|
||
## Run Galileo to geocode the data before moving on to the next functions | ||
|
||
rais_check_new_estabs(2018) | ||
# segundo, aprimorar o geocde utilizando o geocode do gmaps | ||
rais_gmaps_geocode(2018, run_gmaps = FALSE) | ||
# trazer geocode | ||
|
||
# 5) Trazer geocode p/ a base original (da etapa 2) | ||
rais_bring_geocode(2018) | ||
|
||
# 5) Selecionar somente as obsservacoes com boa qualidade de geocode | ||
# 6) Selecionar somente as obsservacoes com boa qualidade de geocode | ||
source("R/fun/filter_geocode.R") | ||
geocode_filter(ano = 2018, "rais") | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
# Aplicar funcoes para o ano de 2019 ------------- | ||
|
||
# 0) Save raw data with columns we use | ||
# 0) Save raw data with columns we use in the municipalities of the project | ||
rais_filter_raw_data(2019) | ||
|
||
# 0.1) Filter raw trabalhadores data | ||
# 1) Filter raw workers data - only private jobs | ||
rais_filter_pessoas(2019) | ||
|
||
# 1) Categorizar trabalhadores por grau de instrucao | ||
# 2) Categorizar trabalhadores por grau de instrucao | ||
rais_categorize_inst(2019) | ||
|
||
# 2) Tratar os outliers | ||
# 3) Tratar os outliers | ||
rais_treat_outliers(2019) | ||
|
||
# 3) Realizar e trazer geocode dos estabelecimentos | ||
# realizar geocode | ||
# 4) Aprimorar o geocode dos estabelecimentos que veio do streetmap | ||
# primeiro, limpar a base completa geocoded que veio do streetmap | ||
rais_clean_estabs_raw(2019) | ||
rais_export_data_to_galileo(2019) | ||
|
||
## Run Galileo to geocode the data before moving on to the next functions | ||
|
||
rais_check_new_estabs(2019) | ||
# segundo, aprimorar o geocde utilizando o geocode do gmaps | ||
rais_gmaps_geocode(2019, run_gmaps = FALSE) | ||
# trazer geocode | ||
rais_bring_geocode(2019) | ||
|
||
# 5) Trazer geocode p/ a base original (da etapa 2) | ||
rais_bring_geocode(2019) | ||
|
||
# 5) Selecionar somente as obsservacoes com boa qualidade de geocode | ||
# 6) Selecionar somente as obsservacoes com boa qualidade de geocode | ||
source("R/fun/filter_geocode.R") | ||
geocode_filter(ano = 2019, "rais") | ||
|
||
|
||
|
||
|
||
|
||
|