Review
selecting columns
filtering rows
creating and arranging columns
100

What type of vector does the c() function create?

What is an atomic vector?

100

This dplyr function will limit your dataframe to the specific columns that you list inside of it.

What is the "select()" function?

Example: select(iris, Species)

100

This dplyr function will limit your dataframe only to the rows that meet a logical condition.

What is the filter() function?

100

This function will create a new column in your data.

What is the mutate() function?

200

Name one way you can index a list vector.

What is:

1. object[number]

2. object[name]

3. object$name

200

You can change the order of columns using the select() function by doing this.

What is "type the names of the columns in the order that you want them to be in"?

Example: select(iris, Species, Petal.Length, Sepal.Length, Petal.Width, Sepal.Width)

200

You can use these inside of the filter() function to tell R which rows you want to keep.

What is a logical operator?

200

This function will order the rows of your data according the columns that you specify.

What is the arrange() function?

300

This code would subset (or "limit") the iris data to the second row and the "Petal.Length" and "Species" column.

What is:

iris[2, c("Petal.Length", "Species")]

300
With select(), you can remove a column by typing a ____ before the column name.

What is a minus sign?

Example: select(iris, -Species)

300

In filter(), a comma (after the first one) is equivalent to which logical operator?

What is the ampersand (&)?

300

These are the arguments taken by the mutate() function.

What is mutate(data, column_name = column_content)?

400

Name two fo the neat features that tibbles that dataframes do not have.

What is:
1. the type of data structure
2. the dimensions of the data structure
3. it prints only the first 10 rows
4. a note showing how many more rows there are
5. a note showing the names of any columns that were not printed
6. NA's are red
7. long numbers are underlined
8. long decimals are underlined
9. each column shows the data type of that column

400

In select(), I can select a range of columns by typing the following in order: 

1. the first column name in the range
2. a ___
3. the last column name in the range

What is a colon?

Example: select(iris, Petal.Length:Species)

400

Which rows would my data have after using the following code:

filter(iris, Species == "virginica")

What are the rows for which Species is equivalent to "virginica"?

400

While the default setting for the arrange() function is to order rows in ascending order, you can use this "helper" function on specific column names to order them in descending order. 

What is the desc() function?

500

The pipe (%>%) does at least two of these cool things.

What is:

1. connects functions together
2. passes column names from the data to each successive function
3. automatically fills in the ".data = " argument for each function so that you don't have to

500

The following code will remove the Sepal.Length through Petal.Length columns, but only if you add _____:

select(iris, -Sepal.Length:Petal.Length)

What are parentheses?

select(iris, -(Sepal.Length:Petal.Length))

500

What code would limit my data only to rows that do not have missing data in the Species column?

filter(iris, ____)

What is filter(iris, !is.na(Species))?

500

In the arrange() function, changing the order of the column names will change what about the ordering of the rows?

What is the order of the priority that rows are ordered by?

M
e
n
u