# Objects in R

In this lesson, you’ll learn some formal definitions and vocabulary for objects in R.

When you are finished, you should be able to…

• Identify the structure of an object

• Identify the data type(s) of an object.

• Understand the required and optional arguments in a function.

• Troubleshoot common error messages

Time Estimates:
Videos: 40 min
Activities: 5 min
Check-ins: 2

## Types and Structures

Required Video: Intro to Object Types and Structures

Optional Reading: More Detail on Object Types and Structures

Check-In 1: Data Structures

This lecture did not mention the important structure of data frames.

That’s because, in essence, a data frame is simply a special list - with a few extra restrictions on the list format.

Think about the datasets you have already worked with. Which of the following restrictions on lists do you think are needed for the list to be a data frame?

1. The elements of the list must all be vectors of the same length.
2. The elements of the list must all be the same data type.
3. The elements of the list must all have no missing values.
4. The elements of the list must all have names.

## Functions

Required Video: Intro to Functions

matrix(c("a", "b", "c", "d"), num_row = 2)
## Error in matrix(c("a", "b", "c", "d"), num_row = 2): unused argument (num_row = 2)