update R script for BDSIR