Analysing materials by measuring the pressure or volume of a gas or vapour