Chevron Left Icon
Introduction to Data Frames in R
Lesson 1 of 2
Chevron Right Icon
  1. 1

    Data lies at the heart of nearly every problem in the business world and society. Having the right tools to manipulate data and organize it in a meaningful way is integral to performing data analys…

  2. 2

    A data frame is an R object that stores tabular data in a table structure made up of rows and columns. You can think of a data frame as a spreadsheet or as a SQL table. While data frames can be cre…

  3. 3

    When working with data frames, most of the time you will load in data from an existing data set. One of the most common formats for big datasets is the CSV. CSV (comma separated values) is a t…

  4. 4

    When you have data in a CSV, you can load it into a data frame in R using […] ‘s […] function: […] In the example above, the […] function is called The CSV file […] is passe…

  5. 5

    When you load a new data frame from a CSV, you want to get an understanding of what the data looks like. If the data frame is small, you can display it by typing its name […] . If the data fram…

  6. 6

    One of the most appealing aspects of dplyr is the ability to easily manipulate data frames. Each of the dplyr functions you will explore takes a data frame as its first argument. The _pipe operato…

  7. 7

    Suppose you have a data frame called […] , which contains the ages of your business’s customers: |name|age|gender| |-|-|-| |Rebecca Erikson|35|F| |Thomas Roberson|28|M| |Diane Ochoa|42|NA| …

  8. 8

    Sometimes rather than specify what columns you want to select from a data frame, it’s easier to state what columns you do not want to select. […] ‘s […] function also enables you to do just …

  9. 9

    In addition to subsetting a data frame by columns, you can also subset a data frame by rows using dplyr’s […] function and comparison operators! Consider an […] data frame that contains dat…

  10. 10

    The […] function also allows for more complex filtering with the help of logical operators! Take a look at the same […] data frame from the last exercise: |id|first_name|last_name|email…

  11. 11

    Sometimes all the data you want is in your data frame, but it’s all unorganized! Step in the handy dandy dplyr function […] ! […] will sort the rows of a data frame in ascending order by the…

  12. 12

    There you have it! With the power of readr and dplyr in your hands, you can now: load data from a CSV into a data frame inspect the data frame with […] and […] * […] the columns you…

  1. 1

    When working with data frames, you often need to modify the columns for your analysis at hand. With the help of the dplyr package, data frame modifications are easily performed. In this lesson, yo…

  2. 2

    Sometimes you might want to add a new column to a data frame. This new column could be a calculation based on the data that you already have. Suppose you own a hardware store called The Handy Woma…

  3. 3

    Let’s refer back to the inventory table for your store, The Handy Woman. |product_id|product_description|cost_to_manufacture|price|sales_tax| |————–|—————————|——-…

  4. 4

    When creating new columns from a data frame, sometimes you are interested in only keeping the new columns you add, and removing the ones you do not need. dplyr’s […] function will add new colum…

  5. 5

    Since dplyr functions operate on data frames using column names, it is often useful to update the column names of a data frame so they are as clear and meaningful as possible. dplyr’s […] funct…

  6. 6

    With an understanding of how to manipulate data frames with dplyr, you are well on your way to becoming a data analysis expert! In this lesson you learned how to: * add new columns to a data frame …

What you'll create

Portfolio projects that showcase your new skills

Pro Logo

How you'll master it

Stress-test your knowledge with quizzes that help commit syntax to memory

Pro Logo