0
I am trying to make an inner_join between two tables by a common "state code" column. However, it is giving an error of "allocate vector of size 1.4 Gb".
Code:
arquivo_antigo_filtrado<- arquivo_antigo %>% select(codigo_estado,PV, PP, PSD, PSCF)
colnames(arquivo_antigo_filtrado) = c("codigo_estado","pv_antigo", "pp_antigo", "psd_antigo", "pscf_antigo")
arquivo_atual_validado<-inner_join(arquivo_atual,arquivo_antigo_filtrado,by="codigo_estado")
Dataset:
Error:
Your computer is not able to separate all this memory space to make this operation you want.
– lmonferrari
codigo_estado
Are there repeated values? That R expects the values to be unique, if they are not they are repeated in all possible combinations, which is what may be causing the creation of this huge vector– Jorge Mendes
And since both data frame have the same number of lines maybe what you want is dlpyr::bind_cols or cbind
– Jorge Mendes
It will not always be the same number of lines, it may vary, only the first that has to be equal.
– Theorp
If
arquivo_antigo
comes from a file and if you no longer need it, rmova it from globalenv,rm(arquivo_antigo)
to free memory. After that, it’s not a bad idea to rungc()
.– Rui Barradas
@Jorgemendes makes total sense, I didn’t realize it. Have some idea of how to solve?
– Theorp
@Theorp Look, here’s analyzing your Jay and see if you don’t need to put another variable as conditions or remove the lines from one of the data frames. That since Join operates in the logic of sql it expects the keys used for the condition to be unique, there is to look at your data and see how to fit it.
– Jorge Mendes