The president has said that Marco Rubio, the secretary of state, will replace Mr Waltz as acting adviser.