Complex sentence: From 1822 until 1829, he was judge of the New York Supreme Court when he was elected president of Columbia College (now Columbia University), where he remained until failing health compelled him to resign in 1842.
Split into simpler sentences: From 1822 until 1829, he was a judge of the New York Supreme Court. In 1829, he was elected president of Columbia College (now Columbia University), where he remained until failing health compelled him to resign in 1842.