What R31 is it? Is it a pinny or a skyline?
Pinny's have different gearbox mount locations to skylines. If it is a skyline any rb engine will physically bolt straight in. The wiring is a different story.
I am not sure on the mods needed to make an rb engine fit into a pinny shell, or dropping a sr20 into an R31.
If you have a manual R31 skyline for example and you stick an sr into it, they have a 3.7 diff, and I would assume the sr has less torque then an rb? that would make it a bit of a slug down low.
Also, what do you want the car for? Daily driver? drags? or just to be different? Different would be going sr, a nice daily would have to be an rb30 turbo.