quiz 2 functions Flashcards
str_length
returns number of the string (size?)
str()
dataset structure (x)
mutate()
add/change columns
facet_wrap()
different graphs based on (~x) variable
color =
color outside of (for points)
dim()
dimentions
fig.cap = “ “
caption (also can go in labs())
summarize()
collapse data into one row /one value
fig.alt = “ “
alternative text (also can go in labs())
pivot_wider()
“widens” data, increasing the number of columns and decreasing the number of rows (data, names_from = name, values_from = values)
geom_histogram()
histogram
class()
return the values of the class attribute of an R object
str_sub()
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)
fct_reorder()
reorder levels according to values of another variable
group_by()
create groups
filter()
select certain rows
geom_point()
scatterplot
select()
select certain columns
semi_join()
return all rows from x with a match in y (x, y)
str_replace()
finds the first part of x
that matches the pattern
and replaces it with replacement
(x, pattern, replacement)
nrow()
number of rows
count()
count all rows in (x)
anti_join()
return all rows from x without a match in y (x, y)
geom_density()
density graph