1/96
an exhaustive list of near everything we've learned this semester (so far)
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
< -
stores value in object
=
assigns values or specifies function arguments
+
addition
-
subtraction
*
multiplication or interaction effects in ANOVA
/
division
^
raises number to a power
%%
returns remainder
==
tests equality
!=
not equal to
>
greater than
<
less than
>=
greater than or equal to
<=
less than or equal to
!
reverses logical value (true becomes false) ; means NOT ; df [ !(df$a >3), ] keep rows where a is NOT greater than 3
&
logical and ; both conditions must be true
|
logical or ; one condition must be true
:
creates a sequence
( )
function call or order of operations
[ ]
extracts element by position
[ [ ] ]
extracts specific component from a list ; returns the actual element itself
$
accesses columns or list
{ }
group code together
~
formula notation ; aov(response variable ~ factor)
%>%
passes output one step to the next
?
help
c( )
combines values into a vector ; vector contains elements that are same type (numeric, character, etc. )
mean( )
calculates mean
sum( )
adds values together
class( )
shows the object type (numeric, character, data.frame, etc.)
str( )
displays object structure
is.integer( )
checks if values or integer
is.character( )
checks if values are character strings
is.na( )
check for missing values
as.numeric( )
converts data to numeric
as.logical( )
converts data to TRUE/FALSE
as.factor( )
converts data to factor ; ANOVA
factor( )
creates categorical variables
seq( )
creates sequences
rep( )
repeats values
sqrt( )
calculates square root
log( )
calculates natural logs
data.frame( )
creates a data frame ; combine vectors into a structured table format ; like a spreadsheet
list( )
creates a list
matrix( )
creates a matrix
table( )
creates frequency table (?)
sort( )
sorts values smallest to largest
order( )
returns positions in order ; x ← c(0, 20, 10, 15) output is 1 3 4 2 since smallest number is at position 1, next smallest is 3, then 4, then 2 (why would you ever do it this way)
rank( )
assigns ranks to values ; x← c(3, 1, 4, 15, 92) output is 2 1 3 4 5
rowSums( )
adds values across rows
colMeans( )
calculates means of columns
subset( )
filters rows using conditions
aggregate( )
summarizes data by groups
tapply( )
applies a function to groups
group_by( )
creates groups for summaries
summarise( )
produces summary statistics
levels( )
displays factor levels
sd( )
calculates standard deviation
var( )
calculates variance
qt( )
returns t critical values
t.test( )
performs a t-test
aov( )
performs ANOVA
summary( )
shows statistical results
TukeyHSD( )
post-hoc after ANOVA
residuals( )
returns model residuals
shapiro.test( )
tests normality
sample( )
generates a random sample
rnorm( )
generates random normal values
set.seed( )
same sequence of random numbers is produced each time the code is run
plot( )
creates base plots in R
barplot( )
creates bar chart
boxplot( )
creates a boxplot
hist( )
creates a historgram
ggplot( )
starts a ggplot graph
aes( )
axes
geom_point( )
creates scatterplot points
geom_line( )
creates line graph
geom_bar( )
creates bar plot
geom_col( )
creates bars from supplies values
geom_boxplot( )
creates boxplot
geom_historgram( )
creates histograms
geom_smooth( )
adds trend lines
geom_errorbar( )
adds error bars
labs( )
adds titles and labels
theme( )
customize plot appearance
theme_classic( )
applies theme to plot
scale_y_continuous
modifies the y-axis scale
sec_axis( )
creates secondary axis
ggsave( )
saves ggplot as image
manova( )
performs MANOVA ; multiple response variables
cbind( )
combines objects by columns
rbind( )
combines objects by rows
summary.aov( )
produces ANOVA summaries ; or use summary(model1) or whatever you names the ANOVA
lm( )
fits linear regression model
paired = TRUE
means R treats each value in group1 as matched with the value in the same position in group2
residuals
observed - predicted ; tells us how far each observation is from what the model predicted
mtcars[mtcars$mpg > 25, ]
the comma means only keep rows where mpg > 25 but keep all columns