There are several ways of displaying subsets of your Spark dataframe. Some of the choices are as follows:
- showDF: This is a Spark command that displays the contents of a dataframe in a condensed manner.
- head: This is the normal R function that can be used on a Spark dataframe; it follows the same syntax as base R.
- take: This command also prints some rows, but collects the rows from the underlying RDD.
- display: This is a special databricks command that is roughly equivalent to the base R View command, but also allows you to plot a subset of the output via control icons below the horizontal scroll bar below the data. Using display also allows you to switch to graphing mode.