You should put your RV's power inverter as close to the battery as possible without being in the same compartment.
Positioning them close to each other reduces the amount of energy that gets lost when it’s transferred from one to the other. Keeping them in separate compartments is a safety precaution in case of combustion.