Guide to gyro and accelerometer with Arduino including Kalman filtering

I am using the Ardu-Imu

R is the co-variance matrix. It should typically be the square of the standard deviation of the Gyro.
I think it should be there in the datasheet, or you could just keep things stationary and log the data for about 5 mins.
Calculate the mean and std deviation.
R=std_deviation^2