Learn R Programming

gmp (version 0.4-10)

apply: apply over a matrix

Description

Theses functions overload apply function for big rationals and big integers

Usage

apply(X, MARGIN, FUN)

Arguments

X
A matrix of class bigz or bigq
MARGIN
1: apply function on rows; 2: apply function of columns
FUN
function to be applied

Value

  • return a vector of class bigz or bigq.

See Also

apply

Examples

Run this code
x = as.bigz(matrix(1:12,3))
  apply(x,1,min)
  apply(x,2,max)
  
  x = as.bigq(matrix(1:12,3))
  apply(x,1,min)
  apply(x,2,max)

Run the code above in your browser using DataLab