Stop the Spark Session and Spark Context.
sparkR.stop() sparkR.session.stop()
Also terminates the backend this R session is connected to.
sparkR.stop since 1.4.0
sparkR.session.stop since 2.0.0