R: add constructor for 'communities' objects (#547).