-1

I have to merge two datasets, but the code "merge" is overloading my computer and it is taking too long to knit. Which code should I use instead?

Here's the code that I used so far:

brm_avrg <- merge(avrg, brm)
head(brm_avrg)
zork1
  • 69
  • 5
  • 1
    The [FAQ on merging data in R](https://stackoverflow.com/q/1299871/903061) offers many solutions. The `data.table` solutions are probably the most memory efficient. But make sure you are joining on unique keys... – Gregor Thomas May 21 '20 at 13:10
  • 1
    Maybe coz you haven't specified the `by` column(s) to join on. – Edward May 21 '20 at 13:53

1 Answers1

0

I looked at the FAQ on merging data in R and I ran the code "full_joint" in order to replace "merge". In order to do that I had to rename an existing common variable of the datasets. Here's the code that I used: codmun_renamed <- rename(brm, codmun = COD_MUN_IBGE) brm_avrg <- full_join(codmun_renamed, avrg) head(brm_avrg)

zork1
  • 69
  • 5