Phase engineering of rare earth nickelates by digital synthesis