Learn R Programming

Rpdb (version 2.0)

coords.atoms: The Atomic Coordinates of an Object of Class atoms

Description

Get or set the atomic coordinates of an object of class atoms.

Usage

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

## S3 method for class 'atoms': coords(x) <- value

Arguments

x
an object of class atoms.
...
further arguments passed to or from other methods.
value
an object of class coords.

Value

  • The getter function return a data.frame of class coords whose columns contain the atomic coordinates of each element of a molecular system. The coordinates can either be Cartesian or fractional coordinates depending on the basis attribute of x.

    The setter function return a atoms object with updated atomic coordinates.

Details

The coords function extract the x1, x2 and x3 components of a atoms object as well as its basis attribute to create a coords object. The coords<- function set the x1, x2 and x3 components of a atoms object as well as its basis attribute.

See Also

basis, coords

Examples

Run this code
x <- read.pdb(system.file("examples/PCBM_ODCB.pdb",package="Rpdb"))
x <- x$atoms
n <- natom(x)
coords(x) <- coords(rnorm(n), rnorm(n), rnorm(n))
head(x)
class(x)
x <- coords(x)
head(x)
class(x)

Run the code above in your browser using DataLab