I have Spark 1.6.2 installed on my system. Also I am using R(3.4.0) with rstudio-server 1.0.143 in CentOS 6.9 machine.
Whenever I am running the command,
sc <- spark_connect(master = "local")
it shows an error message stating that:
Error in spark_version_from_home(spark_home, default = spark_version) : Failed to detect version from SPARK_HOME or SPARK_HOME_VERSION. Try passing the spark version explicitly.