add r dir and scatter demo