Known as Sir Robert Melville of Murdocairnie or Murdochcairnie, Robert was the second son of Sir John Melville of Raith in Fife and Helen Napier of Merchiston.
Robert married firstly; Katherine Adamson; secondly Mary Leslie, daughter of Andrew Leslie, Earl of Rothes; thirdly, Jean Stewart, daughter of Robert, Earl of Orkney.