do duty for vs function as

do duty for

function as

How often have the words do duty for and function as occurred in a corpus of books? (source: Google Ngram Viewer )