Communicating accelerometer data through rf modules using arduinos on both transmitter and receiver sides

You did well and got the code in code tags. Just the IDE autoformat means a lot. Any disorder among the curly brackets, the indentation, shows up clearly.
Hang on and wait for an SPI helper to pop up.