1.3 Working with Data: An Introduction to R

Quick Question

If you want to add new observations to a data frame, what should you use?

Exercise 1

Explanation

To add new observations to a data frame with the same variable values, you should use rbind.

If you want to combine two vectors into a data frame, what should you use?

Exercise 2

Explanation

To combine two vectors into a data frame, you should use data.frame.

If you want to add a variable to your data frame, what should you use?

Exercise 3

Explanation

To add a variable to your data frame, you should the dollar sign notation.