Learn R Programming

Rpdb (version 2.0)

merge.coords: Merge Two Objects of Class coords

Description

Merge by row two data frames of class coords.

Usage

## S3 method for class 'coords':
merge(x, y, \dots)

## S3 method for class 'atoms': merge(x, y, reindex = TRUE, \dots)

Arguments

x, y
objects of class 'coords' to be merged.
reindex
a single element logical vector indicating if residue and element IDs have to be reindexed after merging.
...
further arguments passed to or from other methods.

Value

  • Return a data.frame of the same class as x and y containing by row first x and then y. If x and y have different basis attributes an error is returned.

Details

x and y objects are merged together by row. The basis attribute of these two objects must be the same (see basis). For objects of class atoms the residue and element IDs of y are shifted to avoid any confusion with those of x.

See Also

coords, atoms, basis, merge, merge.data.frame, merge.pdb

Examples

Run this code
c1 <- coords( 1:3 ,  4:6 ,  7:9 , basis = "xyz")
c2 <- coords(10:12, 13:15, 16:18, basis = "xyz")
merge(c1,c2)

## Merging objects with different basis sets return an error.
c2 <- coords(9:11, 12:14, 15:17, basis = "abc")
merge(c1,c2)

Run the code above in your browser using DataLab