Learn R Programming

salad (version 1.2)

c: Concatenation methods

Description

Methods have been defined in order to allow the concatenation of `dual` objects together and with constant objects.

Usage

# S4 method for numericOrArray
c(x, ...)

Value

an object of class dual.

Arguments

x

first object to concatenate

...

other objects

Examples

Run this code
x <- dual( 1 )
# concatenation with a constant
x <- c(x, 2)
x
d(x)
# concatenation of dual objects
x1 <- sum(x)
x2 <- sum(x**2)
y <- c(a = x1, b = x2)  # you can use named arguments
y
d(y)

Run the code above in your browser using DataLab