add r script for consumer