update R scripts for boostrapping