[R] give diagnostic by const&