rprogramming working dir and function practice