extract | R Documentation |
Operators acting on vectors, arrays and lists to extract or replace subsets.
## 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 (but 'bigz' is "the same"): ___
## S3 method for class 'bigq'
c(..., recursive = FALSE)
## S3 method for class 'bigq'
rep(x, times=1, length.out=NA, each=1, ...)
x |
R object of class |
... |
further arguments, notably for |
i , j |
indices, see standard R subsetting and subassignment. |
drop |
logical, unused here, i.e., matrix subsetting always returns a matrix, here! |
times , length.out , each |
integer; typically only one is
specified; for more see |
recursive |
from |
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: 3 x 2
m <- matrix.bigz(1:6,3)
m[1,] # the first row
m[1,, drop=TRUE] # the same: drop does *not* drop
m[1]
m[-c(2,3),]
m[-c(2,3)]
m[c(TRUE,FALSE,FALSE)]
##_modification on matrix
m[2,-1] <- 11
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.