Solid foam board is R-5 per inch of thickness.
High end foam board is R-10 at 1-3/4", and R-12 at 2 1/8 " thick
Fiberglass is rated at R30 @ 10"
The floor and roof of the Grand Design Imagine series is in fact around 10" thick and there is mostly foam in the roof. They can accurately claim R30 and R40 values.
But in reality, I have found their use of insulation EXTREMELY sloppy in the roof and floor. Huge gaps all over the place. And the roof also has many passages that de-rate the insulation average effective value.
So yeah they can claim R30/R40 because they technically have the thickness...but it is absolutely a marketing gimmick.