integer
64
Character
"A"
Boolean value (either true or false)
TRUE
Complex number
2 + i
Addition
Unary positive, makes number positive
Subtraction
Unary negative, makes number negative
Multiplication
Division
Modulo (remainder of division)
Modulo (remainder of division)
Equals
Is equal to
Is not equal to
Greater than
Less than
Greater than or equal to
Less than or equal to
Checks if an object is a certain type
Elementwise AND
Elementwise OR
Logical AND
Logical OR
Logical NOT
Used to separate parameters
References a data structure's index (starting from 1, not 0)
list[3]
References a sub-data structure by passing a datastructure with boolean datavalues to determine which indexes are accepted in the sub-data structure
Defines a block
Creates a vector of numbers in a sequence
1:5 # same as c(1,2,3,4,5) or seq(from=1,to=5,by=1)
Matrix multiplication
Declares a character
Declares a character
Accesses a variable in the list
list$names
Links an independent and dependent variable for regression
Executes code if condition is true
if (condition) {
code
}
Loops code while a condition is true
while (condition) {
code
}
Loops code for a set amount iterations or for every object in list
for (variable in array) {
code
}
f <- function () {
code
}
Loops code until error
repeat {
code
}
Sets the R file to execute
Pipes output to some file, or on no input, to the command line
Returns whether a value is NA
Returns true if any data value in the input is true
returns the length of a list
Converts vector to matrix
dim(vec) <- c(2,3) #This makes a 2*3 matrix
Creates a vector filled with random data values from some range
sample(1:5,20,rep=T)
Creates a linear model from two vectors of data
lm(data$x ~ data$y)
mod1 <- lm(x ~ y, data = dat)
Returns data from a CSV file
dat < read.csv("~/path/to/dataset.csv")
Summary of information on a linear model
summary(mod1)
Creates a data plot
plot(x, y, xlab, ylab)
Calculates the CDF for Student's T distribution up to some T-test statistic
pt(0.69, 198) # pt(statistic, df, lower.tail=)
Calculates the CDF for Student's T distribution up to some T-test statistic
List of data values of the same type
Two dimensional dataset with columns and rows
matrix(c(1,0,0,0,1,0,0,0,1), nrow=3, ncol=2)
Ordered and mutable List of data values
Used to tell compiler the rest of this line is not to be compiled
#This isn't executed