Level 5 Level 7
Level 6

Numerical summaries


23 words 0 ignored

Ready to learn       Ready to review

Ignore words

Check the boxes below to ignore/unignore words, then click save at the bottom. Ignored words will never appear in any learning session.

All None

Ignore?
max(V)
returns the maxima of input values V
min(V)
returns the minima of input values V
mean(V)
returns the (trimmed) arithmetic mean of input values V (numeric/logical vectors and date, date-time and time interval objects)
quantile(V, probs=c(0.2, 0.8))
returns sample quantiles of V corresponding to the given probabilities (e.g. 0.2 and 0.8)
median(V)
returns sample median of V
sum(V)
returns the sum of all the values present in its arguments (e.g. numeric or complex or logical vector V)
sd(V)
computes the standard deviation of the values in V
cov(M)
compute the variance and covariance of M
cor(M)
compute the correlation of M
summary(Df)
prints summary statistics on various objects, also used on data structures (e.g. a data frame Df)
rank(V)
returns the sample ranks of the values in vector V
sort(V)
sort a vector or factor V into ascending or descending order
order(V1, V2, V3)
often used to sort data frames, returns a permutation which rearranges its first argument into ascending or descending order breaking ties by further arguments (e.g. V1, V2, V3)
aggregate(V1, by=V2, FUN=median)
splits V1 into subsets by V2, computes summary statistics (e.g. median) for each
aggregate(var1 ~ var2, data=Df, FUN=median)
splits variable var1 into subsets by variable var2 in data frame Df (formula interface) and computes summary statistics (e.g. median)
ave(V1, V2)
averages of V1 grouped by V2 (typically factors), result is a numeric vector of same length as V1
tabulate(V)
takes the integer-valued vector V and counts the number of times each integer occurs in it
table(V1, V2, V3)
build a contingency table of the counts at each combination of V1, V2, V3
by(Df, INDICES=L, FUN=lm)
apply function (e.g. lm, a linear model) to data frame Df by a list of factors L
apply(M, MARGIN=2, FUN=mean)
apply function (e.g. mean) to M by rows or columns (e.g. MARIGIN=2)
lapply(L, FUN=lm)
returns a list of the same length as L, each element of which is the result of applying function (e.g. lm, a linear model) to the corresponding element of L
sapply(L, FUN=quantile)
a user-friendly version of lapply by default returning a vector, matrix with result of applying function (e.g. quantile) to the corresponding element of L
tapply(V, INDEX=L, FUN=mean)
apply function (e.g. mean) to each (non-empty) group of values in V given by a list of factors L, used also by convenience functions by and aggregate