Learn R Programming

salad (version 1.2)

Extract: Extract or replace parts of an object

Description

Methods for extraction or replacements of parts of dual objects.

Usage

# S4 method for dual,index,index,dual
[(x, i, j, ...) <- value

# S4 method for dual,missing,index,dual [(x, i, j, ...) <- value

# S4 method for dual,index,missing,dual [(x, i, j, ...) <- value

# S4 method for dual,missing,missing,dual [(x, i, j, ...) <- value

# S4 method for dual,index,index,logicalOrNumericOrArray [(x, i, j, ...) <- value

# S4 method for dual,missing,index,logicalOrNumericOrArray [(x, i, j, ...) <- value

# S4 method for dual,index,missing,logicalOrNumericOrArray [(x, i, j, ...) <- value

# S4 method for dual,missing,missing,logicalOrNumericOrArray [(x, i, j, ...) <- value

# S4 method for dual,index,index [(x, i, j, ..., drop = TRUE)

# S4 method for dual,missing,index [(x, i, j, ..., drop = TRUE)

# S4 method for dual,index,missing [(x, i, j, ..., drop = TRUE)

# S4 method for dual,missing,missing [(x, i, j, ..., drop = TRUE)

Value

returns a dual object (the semantic is the same as base extraction and replacement methods).

Arguments

x

dual object

i, j

indices of elements to extract or replace

...

supplementary indices (for arrays)

value

replacement value

drop

for dual matrices or array.

Examples

Run this code
x <- c(1, 2, 3)
x[2] <- dual(4)
x
d(x)

Run the code above in your browser using DataLab