I have large and a small table (in fact thousands of rows and columns).
E.g.
large <- data.frame(v1 = c(1,2,NA,4,NA,6,NA,NA),v2 = c("A","E","C","B","G","H","Z","Y"))
small <- data.frame(v3 = c("C","Y"), v4 = c("3.4","6"))
Note the unique names in both tables. Ho can I fill up the values 3.4 and 6 into the column v1 from small$v4 without touching the rest?
> large
v1 v2
1 1 A
2 2 E
3 NA C
4 4 B
5 NA G
6 6 H
7 NA Z
8 NA Y
> small
v3 v4
1 C 3.4
2 Y 6
This should be the result:
> large.new
v1 v2
1 1.0 A
2 2.0 E
3 3.4 C
4 4.0 B
5 NA G
6 6.0 H
7 NA Z
8 6.0 Y
I tried merge() and match[] but they delete all the other data in the large columns ?!
Thank you, team !