Obtaining Rotation Matrix from RTIMULIB?

Hi,
I am using RTIMULIB to obtain sensor readings from a 9dof IMU and have been obtaining the following readings (with the z axis of the IMU pointing [approx.] up):

Accel: x:-0.10 y:0.01 z:-0.96
Gyro: x:0.00 y:-0.01 z:-0.00
Mag: x:6.93 y:-13.93 z:-8.93
Pose: x:179.30 y:5.86 z:-60.59
Accel: x:-0.09 y:0.02 z:-0.96
Gyro: x:-0.01 y:0.01 z:0.01
Mag: x:7.20 y:-14.31 z:-8.60
Pose: x:179.26 y:5.77 z:-61.30

When I rotate the IMU such that the X axis is pointing [approx.] up, I get the following readings :

Accel: x:-0.99 y:0.03 z:0.05
Gyro: x:0.00 y:-0.01 z:-0.00
Mag: x:-39.98 y:8.04 z:-4.99
Pose: x:31.55 y:86.39 z:-105.30
Accel: x:-0.99 y:0.03 z:0.06
Gyro: x:-0.00 y:-0.00 z:-0.00
Mag: x:-40.30 y:8.59 z:-4.51
Pose: x:29.15 y:86.21 z:-106.43

I would like to convert the accelerometer (and possibly Gyro) reading to the earth frame. My understanding is that this is done by vector multiplication between the readings and a Rotation Matrix. So my question is does RTIMULIB contain this calculation and if so how do I call it from my arduino code, or if not, can I get the Rotation Matrix from RTiMULIB to perform the calculations myself?

Many Thanks.