Introduction to the Tidyverse

0.0(0)
Studied by 0 people
call kaiCall Kai
Locked
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/24

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 3:17 PM on 7/21/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

25 Terms

1
New cards

FRONT

BACK

2
New cards

What function produces a changed version of data? What is something special you can do with this function? What would the code look like for modifying and adding data?

mutate()

Something special you can do with this function is add a new variable to the modified table

mutate(oldVar = operation, newVar = operation)

3
New cards

How do you set the width of the bars of a histogram? How do you see the number of bins?

as a part of geom_histogram():

geom_histogram(binwidth = num, bins = num)

4
New cards

FIRST PASS

FIRST PASS

5
New cards

How would you code creating subplots when creating a plot?

+ facet_wrap(~ var)

6
New cards

How would you code a scatterplot’s axis starting at zero when it doesn’t normally do so?

+ expand_limits(x = 0)

+ expand_limits(y = 0)

7
New cards

How would you code a ggplot as a box plot?

+ geom_boxplot()

8
New cards

SECOND PASS

SECOND PASS

9
New cards

What function allows you to look at a subset of a dataset that meets specific conditions?

filter()

10
New cards

What TOOL allows you to apply several functions in succession to a dataset? What are the two forms of this tool? Give an example of using it

A pipe

%>%

|>

dataset |> function()

11
New cards

What function arranges the data in a certain way? How would you make the data ascending or descending using this function?

arrange()

This function is ascending by default

arrange(desc(var)) (descending)

12
New cards

What function creates a visual for ggplot2?

ggplot()

13
New cards

What is the code format to create an xy scatterplot for ggplot2?

ggplot(data, aes(x = labelx, y = label y)) + geom_point()

14
New cards

What code makes a ggplot axis logarathmic?

+ scale_x_log10()

+ scale_y_log10()

15
New cards

How would you code passing color as an argument to a scatterplot?

aes(color = var)

16
New cards

How would you code passing dot size as an argument to a scatterplot?

aes(size = var)

17
New cards

What function allows you to summarize part of a dataset? What does this look like coded?

summarize()

summarize(newColumnName = var)

18
New cards

What are the result of these two operations in R?

a.

1 +

1

b.

1

+ 1

a. 2

b. 1 1

19
New cards

What function allows you to reframe the presentation of a dataset based off of a chosen variable or chosen variables?

group_by()

20
New cards

Why does the order of arguments in group_by matter?

Former arguments takes preference in presentation over latter arguments

21
New cards

How would you code a ggplot as a line plot?

+ geom_line()

22
New cards

How would you code a ggplot as a bar plot?

+ geom_col()

23
New cards

How can you cause errors with a lack of specificity in using the filter function?

If you don’t make sure your variable is the correct data type. For instance, if you’re trying to match a string, and you code:
x == var

instead of:

x == “var”

24
New cards

How would you code a ggplot as a histogram?

+ geom_histogram()

25
New cards

How do you add a title to a plot in ggplot?

+ labs(title = ““)