Calculate the hash of the digest email address:
d <- digest(' ab@c.com ', algo='md5', serialize=FALSE) d
Then ask gravatar for the image:
download.file(paste0('http://www.gravatar.com/avatar/', d, '.png?d=identicon'), mode='wb', destfile='ab.png')

Windows systems require mode='wb' . mode='w' by default, and the b flag is ignored on systems other than Windows.
source share