03-14-2022 07:34 AM
Community
I’ve been struggling with utilizing R language in databricks and after reading “Mastering Spark with R,” I believe my initial problems stemmed from not understating the difference between Spark DataFrames and R DataFrames within the databricks environment. Now that I know many R function will only work with R DataFrames I’ve become quite familiar with the collect() function and the copy_to() function to convert back and forth between dataframe types. So my question deals with are there any sort of Rules of Thumb with regards to Spark /R dataframes when using R in databricks. As it seems as though I am converting back and forth a lot.
Jeff
03-15-2022 12:41 AM
ggplot2 is not included by default I believe. You will have to install it yourself.
https://spark-packages.org/package/SKKU-SKT/ggplot2.SparkR
http://papl-skku.github.io/ggplot2.SparkR/index
As it is a popular package, chances are real it might be included in the future.
03-14-2022 08:18 AM
As Spark dataframes are handled in distributed way on workers it is better just to use Spark dataframes. Additionally collect is executed on driver and takes whole dataset into memory so it is shouldn't be used in production.
03-14-2022 08:45 AM
That certainly makes sense but I've run into a number of R functions which error out on Spark DataFrames. For example geohashTools and ggplot2 (in particular ggplot2) only work with R DataFrames (as I understand).
03-15-2022 12:41 AM
ggplot2 is not included by default I believe. You will have to install it yourself.
https://spark-packages.org/package/SKKU-SKT/ggplot2.SparkR
http://papl-skku.github.io/ggplot2.SparkR/index
As it is a popular package, chances are real it might be included in the future.
04-27-2022 01:01 AM
Hi @Jeff Reichman , Just a friendly follow-up. Do you still need help, or do the above responses help you find the solution? Please let us know.
Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.
If there isn’t a group near you, start one and help create a community that brings people together.
Request a New Group