Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

extract

Extract or Replace Parts of an Object


Description

Operators acting on vectors, arrays and lists to extract or replace subsets.

Usage

## S3 method for class 'bigz'
x[i=NULL, j=NULL, drop = TRUE]
## S3 method for class 'bigq'
x[i=NULL, j=NULL, drop = TRUE]

##_______ In the following, only the bigq method is mentioned: ______



## S3 method for class 'bigq'
c(..., recursive = FALSE)
## S3 method for class 'bigq'
rep(x, times=1, length.out=NA, each=1, ...)

Arguments

x

R object of class "bigz" or "bigq", respectively.

...

further arguments, notably for c().

i,j

indices, see standard R subsetting and subassignment.

drop

logical, unused here.

times, length.out, each

integer; typically only one is specified; for more see rep (standard R, package base).

recursive

unused here

Note

Unlike standard matrices, x[i] and x[i,] do the same.

Examples

a <- as.bigz(123)
  ## indexing "outside" --> extends the vectors (filling with NA)
  a[2] <- a[1]
  a[4] <- -4

  ## create a vector of 3 a
  c(a,a,a)

  ## repeate a 5 times
  rep(a,5)

  ## with matrix
  m <- matrix.bigz(1:6,3)

  ## these do the same:
  m[1,]
  m[1]
  m[-c(2,3),]
  m[-c(2,3)]
  m[c(TRUE,FALSE,FALSE)]

  ##_modification on matrix
  m[2,-1] <- 11

gmp

Multiple Precision Arithmetic

v0.6-2
GPL (>= 2)
Authors
Antoine Lucas, Immanuel Scholz, Rainer Boehme <rb-gmp@reflex-studio.de>, Sylvain Jasson <Sylvain.Jasson@inrae.fr>, Martin Maechler <maechler@stat.math.ethz.ch>
Initial release
2021-01-07

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.