quiz 2 functions Flashcards

1
Q

str_length

A

returns number of the string (size?)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

str()

A

dataset structure (x)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

mutate()

A

add/change columns

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

facet_wrap()

A

different graphs based on (~x) variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

color =

A

color outside of (for points)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

dim()

A

dimentions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

fig.cap = “ “

A

caption (also can go in labs())

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

summarize()

A

collapse data into one row /one value

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

fig.alt = “ “

A

alternative text (also can go in labs())

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

pivot_wider()

A

“widens” data, increasing the number of columns and decreasing the number of rows (data, names_from = name, values_from = values)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

geom_histogram()

A

histogram

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

class()

A

return the values of the class attribute of an R object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

str_sub()

A

keeps a subset of characters in x, from start (a number indexing first letter to keep) to end (a number indexing last letter to keep) (x, start, end)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

fct_reorder()

A

reorder levels according to values of another variable

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

group_by()

A

create groups

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

filter()

A

select certain rows

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

geom_point()

A

scatterplot

18
Q

select()

A

select certain columns

19
Q

semi_join()

A

return all rows from x with a match in y (x, y)

20
Q

str_replace()

A

finds the first part of x that matches the pattern and replaces it with replacement (x, pattern, replacement)

21
Q

nrow()

A

number of rows

22
Q

count()

A

count all rows in (x)

23
Q

anti_join()

A

return all rows from x without a match in y (x, y)

24
Q

geom_density()

A

density graph

25
str_detect()
finds pattern in column x (x, pattern), returns true/false
26
geom_bar()
bar graph
27
pivot_longer()
"lengthens" data, increasing the number of rows and decreasing the number of columns (data, cols, names_to = "name", values_to = "values", values_drop_na = FALSE)
28
fill =
fill inside of (for bars)
29
inner_join()
only keeps observations from x that have a matching key in y (x, y)
30
head()
first 6
31
geom_smooth()
line based on least squares, but trend lines by default
32
str_extract()
finds the *first* part of `x` that matches the `pattern` and takes it (x, pattern)
33
fct_recode()
manually change levels (x, "new" = "old")
34
geom_boxplot()
box plot
35
str_replace_all()
finds *all* instances in `x` that matches the `pattern` and replaces it with `replacement` (x, pattern, replacement)
36
arrange()
reorder data
37
full_join()
keeps all observations in x and y (adds NA's)
38
left_join()
keeps all observations in x (x, y)
39
geom_line()
line graph
40
str_to_lower()
all upper case letters in `x` to lower case (x)
41
fct_relevel()
manually reorders levels (x, c("", "",""))