Robert Heath Lock was the son of John Bascombe Locke, an Eton schoolmaster and writer of mathematical textbooks.
Born at Eton College on 19 January 1879, he was educated at Charterhouse and Caius College, Cambridge, where he graduated in the Natural Sciences Tripos in 1902.
Appointed Scientific Assistant to the Director of the Royal Botanic Gardens at Peradeniya in 1902, he returned to Cambridge in 1905 to be Curator of the Cambridge University Herbarium. In 1908 he became Assistant Director of the Royal Botanic Gardens, Peradeniya, serving as Acting Director in 1909 and 1912. He specialized in the breeding of Hevea brasiliensis for rubber production.
In 1910 Lock married Bella Sidney Woolf, the sister of Leonard Woolf.