1/24
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
FRONT
BACK
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)
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)
FIRST PASS
FIRST PASS
How would you code creating subplots when creating a plot?
+ facet_wrap(~ var)
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)
How would you code a ggplot as a box plot?
+ geom_boxplot()
SECOND PASS
SECOND PASS
What function allows you to look at a subset of a dataset that meets specific conditions?
filter()
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()
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)
What function creates a visual for ggplot2?
ggplot()
What is the code format to create an xy scatterplot for ggplot2?
ggplot(data, aes(x = labelx, y = label y)) + geom_point()
What code makes a ggplot axis logarathmic?
+ scale_x_log10()
+ scale_y_log10()
How would you code passing color as an argument to a scatterplot?
aes(color = var)
How would you code passing dot size as an argument to a scatterplot?
aes(size = var)
What function allows you to summarize part of a dataset? What does this look like coded?
summarize()
summarize(newColumnName = var)
What are the result of these two operations in R?
a.
1 +
1
b.
1
+ 1
a. 2
b. 1 1
What function allows you to reframe the presentation of a dataset based off of a chosen variable or chosen variables?
group_by()
Why does the order of arguments in group_by matter?
Former arguments takes preference in presentation over latter arguments
How would you code a ggplot as a line plot?
+ geom_line()
How would you code a ggplot as a bar plot?
+ geom_col()
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”
How would you code a ggplot as a histogram?
+ geom_histogram()
How do you add a title to a plot in ggplot?
+ labs(title = ““)