## Merge two 'pdb' objects
x1 <- read.pdb(system.file("examples/PCBM_ODCB.pdb",package="Rpdb"))
x2 <- x1
x2$atoms$x1 <- x2$atoms$x1 + 10
y <- merge(x1, x2)
## Two merge more than two 'pdb' objects together
## first create a list of 'pdb' objects and use the reduce function to merged them all.
x3 <- x1
x3$atoms$x1 <- x3$atoms$x1 - 10
L <- list(x1, x2, x3)
y <- Reduce(merge, L)Run the code above in your browser using DataLab