For example
A
4 5 7
1 4 7
Inf 4 5
4 Inf 0
B
0 5 8
0 5 1
2 4 5
0 9 2
I need a new data frame C where the infinite values do not appear and instead will appear the values of B in the same position. Like this:
C
4 5 7
1 4 7
2 4 5
4 9 0
How can I get C?