An even more gentle introduction to the dplyr package

As suggested by the heading, this section is a really brief introduction to the dplyr package. The main purpose of this package is to provide an efficient and consistent way of performing common data wrangling operations.

The main idea here is the one of representing those operations with verbs. dplyr has essentially got the following seven main verbs:

  • filter(): To let you filter your data frame based on some given condition
  • arrange(): To change the disposition of columns and sort values within columns
  • select(): To select one or more specific columns within a data frame
  • rename(): To change the name of a column
  • distinct(): To produce a list of distinct, unique values within a column or the full data frame
  • mutate(): To add attributes (columns) to a data frame
  • summarise(): To aggregate attributes of a data frame around some given key

You are not required to learn all of them now because we are going to introduce and practice them along our journey. At the moment, you just need to put them into your backpack, together with data frames, vectors, and pipe operators.

Finally, the time has come to experiment with the power of R and gain knowledge about your financial habits.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset