-
Notifications
You must be signed in to change notification settings - Fork 0
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
8 changed files
with
93 additions
and
51 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
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
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
a63cd82
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dhersz, voce chegou a vers esta forma de fazer o merge no final é mais rapida do que via data.table?
to vendo que é mais Base-R. pessoalmente eu acho pouco transparente esta estratégia de merge baseada no nome das posicoes do vetor. Se fo mais rapida tudo bem. Se nao for melhor criar um data.table interno e fazer o merge A[B,on='var']
a63cd82
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
É mais rápido sim, fiz uns testes na hora. Exemplo usando os logradouros da RAIS (3.1 milhões de registros totais, 2.4 mi únicos):
Usando a base de bairros, que tem mais valores repetidos (3.1 milhões totais, 166k únicos):
Quanto maior o número de valores únicos, maior o ganho de tempo de fazer o merge dessa forma.
Confesso que não pensei muito na questão da transparência na hora de implementar. Já é uma estratégia que uso há muito tempo quando preciso fazer o "look up" entre dois vetores, então veio naturalmente e já internalizei o bastante pra achar legível. Se achar que nesse caso é melhor priorizar a transparência, posso adaptar.