Update R/calculate_intensity.R : change error() function to stop() funct...

...ion

Change error() function, which is not a valid function, to stop() function