Visualizing data

Visualization is a powerful way to communicate information through graphical means. Visual presentations make data easier to comprehend. This recipe presents some basic functions to plot charts, and demonstrates how visualizations are helpful in data exploration.

Getting ready

Ensure that you have completed the previous recipes by installing R on your operating system.

How to do it...

Perform the following steps to visualize a dataset:

  1. Load the iris data into the R session:
    > data(iris)
    
  2. Calculate the frequency of species within the iris using the table command:
    > table.iris = table(iris$Species)
    > table.iris
    
        setosa versicolor  virginica 
            50         50         50 
    
  3. As the frequency in the table shows, each species represents 1/3 of the iris data. We ...

Get R: Recipes for Analysis, Visualization and Machine Learning now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.