append: Append elements to a vector-like object

Description Usage Arguments Value See Also Examples

Description

Append (or insert) elements to (in) a vector-like object.

NOTE: This man page is for the append S4 generic function defined in the BiocGenerics package. See ?base::append for the default method (defined in the base package). Bioconductor packages can define specific methods for objects (typically vector-like or data-frame-like) not supported by the default method.

Usage

1
append(x, values, after=length(x))

Arguments

x

The vector-like object to be modified.

values

The vector-like object containing the values to be appended to x. values would typically be of the same class as x, but not necessarily.

after

A subscript, after which the values are to be appended.

Value

See ?base::append for the value returned by the default method.

Specific methods defined in Bioconductor packages will typically return an object of the same class as x and of length length(x) + length(values).

See Also

Examples

1
2
3
append  # note the dispatch on the 'x' and 'values' args only
showMethods("append")
selectMethod("append", c("ANY", "ANY"))  # the default method

Example output

Loading required package: parallel

Attaching package: 'BiocGenerics'

The following objects are masked from 'package:parallel':

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from 'package:stats':

    IQR, mad, xtabs

The following objects are masked from 'package:base':

    Filter, Find, Map, Position, Reduce, anyDuplicated, append,
    as.data.frame, cbind, colnames, do.call, duplicated, eval, evalq,
    get, grep, grepl, intersect, is.unsorted, lapply, lengths, mapply,
    match, mget, order, paste, pmax, pmax.int, pmin, pmin.int, rank,
    rbind, rownames, sapply, setdiff, sort, table, tapply, union,
    unique, unsplit, which, which.max, which.min

standardGeneric for "append" defined from package "BiocGenerics"

function (x, values, after = length(x)) 
standardGeneric("append")
<environment: 0x1be6440>
Methods may be defined for arguments: x, values
Use  showMethods("append")  for currently available ones.
Function: append (package BiocGenerics)
x="ANY"

Method Definition (Class "derivedDefaultMethod"):

function (x, values, after = length(x)) 
{
    lengx <- length(x)
    if (!after) 
        c(values, x)
    else if (after >= lengx) 
        c(x, values)
    else c(x[1L:after], values, x[(after + 1L):lengx])
}
<environment: namespace:base>

Signatures:
        x    
target  "ANY"
defined "ANY"

BiocGenerics documentation built on April 17, 2021, 6:01 p.m.