Math Flashcards Preview

R > Math > Flashcards

Flashcards in Math Deck (18)
Loading flashcards...
1

sin,cos,tan,asin,acos,atan,atan2,log,log10,exp max(x) min(x) sum(x) mean(x) median(x) rank(x) var(x) sd(x) cor(x) var(x, y) cor(x, y)

simple math functions

2

range(x)

id. then c(min(x), max(x))

3

diff(x)

lagged and iterated differences of vector x

4

prod(x)

product of the elements of x

5

quantile(x,probs=)

sample quantiles corresponding to the given prob-
abilities (defaults to 0,.25,.5,.75,1)

6

weighted.mean(x, w)

mean of x with weights w

7

round(x, n)

round(x, n)

8

log(x, base)

computes the logarithm of x with base base

9

scale(x)

if x is a matrix, centers and reduces the data; to center only use
the option center=FALSE, to reduce only scale=FALSE (by default
center=TRUE, scale=TRUE)

10

pmin(x,y,...)

a vector which ith element is the minimum of x[i],
y[i], . . .

11

pmax(x,y,...)

d. for the maximum

12

cumsum(x)

a vector which ith element is the sum from x[1] to x[i]

13

cumprod(x)

d. for the product

14

cummin(x)

id. for the minimum

15

cummax(x)

d. for the maximum

16

union(x,y), intersect(x,y), setdiff(x,y), setequal(x,y),
is.element(el,set)

“set” functions

17

Mod(x)

modulus; abs(x) is the same

18