8 Flashcards
1
Q
Sums of the columns (sum top down of each column)?
A
colSums(matrix)
2
Q
Sum of rows in a matrix (left right of each row)?
A
rowSums(matrix)
3
Q
Means of rows and columns of matrix?
A
rowMeans(matrix)
colMeans(matrix)
4
Q
Sample standard deviation?
A
sd(x)
5
Q
sample variance?
A
var(x)
6
Q
Sample covariance?
A
cov(x, y)
7
Q
Variance covariance of dataframe?
A
cov(dataframe)
8
Q
Correlation between two vectors?
A
cor(x, y)
9
Q
Median?
A
median(x)
10
Q
five number summary?
A
fivenum(x)
11
Q
Quantile?
A
quantile(x, probs)
12
Q
Structure?
A
str(x)
13
Q
Find dimensions?
A
dim(matrix), will output rows, columns
14
Q
Apply a function to either rows or columns of a matrix?
A
apply(matrix, margins, function, parameters), margins = 1 (rows), 2 (columns)