Powershell Increment Variable In Function In R Programming