O'Reilly logo

R Data Mining by Andrea Cirillo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Visualizing the number of movements per day of the week

As a warm up, let's visualize the number of movements per day. We are going to do this starting from the daily_summary data frame. How do we do that? First of all, let's choose the right type of chart. I can wait for you here while you look at the previous section and try to work out which is the best chart for our purposes.

Since we are going to compare the values of the same attribute (the number of movements) across different values of a categorical variable (day of the week), our best possible choice is going to be a bar plot.

What do we need for a bar plot in ggplot?

  • A ggplot() call, passing the following:
    • The daily_summary object as the data argument
    • name_of_the_day and number_of_movements ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required