working version of InterVA4 R replicate