Saturday, 20 April 2013

R: Basic Mathematical Functions

R can perform the usual mathematical operations, below are the functions:

Arithmetic
  • +    - addition
  • -    - subtraction
  • *    - multiplication
  • /    - division

Trigonometry
  • sin      - sine
  • cos      - cosine
  • tan      - tangent
  • asin    - sine inverse
  • acos    - cosine inverse
  • atan    - tangent inverse

Linear Algebra
  • +            - element-wise addition
  • -            - element-wise subtraction
  • *            - element-wise multiplication
  • /            - element-wise division
  • %*%        - matrix multiplication
  • t            - transpose
  • eigen    - eigenvalues and eigenvectors
  • solve    - inverse of matrix
  • ginv      - generalized inverse, requires MASS package
  • rbind    - combines vectors of observations horizontally into matrix class
  • cbind    - combines vectors of observations vertically into matrix class


Reference:
  1. Kabacoff, R. I. Matrix Algebra. Quick-R. Retrieved April 20, 2013.
  2. Trigonometric Functions. R Documentation. R.2.15.1

No comments:

Post a Comment