update R and python code