Adding test script for R to validate function