rational-extract | R Documentation |
Extract from a rational vector
## S4 method for signature 'rationalS4'
x[i, j, ..., drop = TRUE]
## S4 replacement method for signature 'rationalS4'
x[i, j, ...] <- value
## S4 method for signature 'rationalS4'
x[[i, ..., drop]]
## S4 replacement method for signature 'rationalS4'
x[[i, j, ...]] <- value
## S3 method for class 'rationalS3'
x[i, ..., drop = TRUE]
## S3 replacement method for class 'rationalS3'
x[i, ...] <- value
## S3 method for class 'rationalS3'
x[[i, ..., exact = TRUE]]
## S3 replacement method for class 'rationalS3'
x[[i, ...]] <- value
## S3 method for class 'rationalR6'
x[i, ..., drop = TRUE]
## S3 replacement method for class 'rationalR6'
x[i, ...] <- value
## S3 method for class 'rationalR6'
x[[i, ..., exact = TRUE]]
## S3 replacement method for class 'rationalR6'
x[[i, ...]] <- value
## S3 method for class ''rational::rationalS7''
x[i, ..., drop = TRUE]
## S3 replacement method for class ''rational::rationalS7''
x[i, j, ...] <- value
## S3 method for class ''rational::rationalS7''
x[[i, j, ..., drop]]
## S3 replacement method for class ''rational::rationalS7''
x[[i, j, ...]] <- value
x |
the rational number |
i |
index specifying elements |
j |
index specifying elements |
... |
indices specifying elements to extract or replace. Indices are numeric or character vectors or empty (missing) or NULL. |
drop |
For matrices and arrays. If TRUE the result is coerced to the lowest possible dimension (see the examples). This only works for extracting elements, not for the replacement. See drop for further details. |
value |
the replacement value |
exact |
controls partial matching when extracting by character |
Extract
for more full descriptions
a <- rational(c(3L, 5L, 6L), c(4L, 5L, 7L), "S4")
stopifnot(a[2]@n == 5L)
stopifnot(all(a[2:3]@n == c(5,6)))
a <- rational(c(3L, 5L, 6L), c(4L, 5L, 7L), "S3")
stopifnot(a[2]$n == 5L)
stopifnot(all(a[2:3]$n == c(5,6)))
a <- rational(c(3L, 5L, 6L), c(4L, 5L, 7L), "R6")
stopifnot(a[2]$getNumerator() == 5L)
stopifnot(all(a[2:3]$n == c(5,6)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.