1/13
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
%>%
is the pipe operator. This let’s you do a bunch of steps to your data in a row, like a to-do list, instead of writing messy nested code. "Take the data, then clean it, then group it, then summarise it."
c()
is the combine function. It builds a list of values.
c("Enzo", "Ysabella", "Stacie", "Naobi", "Gab")
runif()
is the random uniform function. This makes up random numbers from a uniform distribution for you. Handy when you don't have real data yet but want to test if your code works.
geom_point()
is point geometry. It draws dots on a graph. You use this when you want to see how two things relate, like height vs. weight.
<-
is the left assignment operator. This operator saves something with a name so you can use it again later. Like putting a label on a box so you remember what's inside.
seq()
is the sequence function. It makes a list of numbers that go up in steps; like 0, 2, 4, 6, 8. Useful for making an axis on a graph or spacing out values evenly.
ggplot()
is simply the ggplot function. This starts a graph. It's like opening a blank canvas before you start drawing on it.
aes()
is the aesthetic mapping function. It tells the graph what goes where. Like saying "put this column on the x-axis, that column on the y-axis, and color the dots by this other column."
select()
is the select function. In simple terms: it lets you pick out specific columns from your dataset and drop the rest. Like if your data has 20 columns but you only care about 3, select() lets you keep just those.
mutate()
is the mutate function. It lets you add a new column—or change an existing one—in your dataframe. Often by calculating it from other columns.
mutate(total=price*quantity) or mutate(theOpps=c("Ihita", "Arsha", "Rooni"))
What is an object?
An object is anything that stores data or instructions that R can use. We refer to objects by their names.
What is a vector?
A vector in R is a list of values all of the same type, stored in order.
What is an argument?
An argument is a piece of information you give to a function so it knows what to do.
set.seed
is used to make random number generation reproducible — meaning if you run the same code again, you'll get the exact same "random" results instead of different ones each time. How big the number is doesn’t matter—meaning the seed 1 and 100 doesn’t mean one seed is more random than the other.