check_validity: Validity and compatibility of cry objects

View source: R/validations.R

check_validityR Documentation

Validity and compatibility of cry objects

Description

Compatibility of cry objects The objects that can be created in cry are subject to issues of compatibility of the parameters forming them. For example, the unit cell of a cubic system cannot have the a, b, c sides different from each other. The present function returns TRUE if all parts composing the object are compatible with each other. Otherwise it returns FALSE and one or more warnings with details.

Usage

check_validity(x, y = NULL, message = FALSE)

Arguments

x

A first object of one of the new cry classes.

y

A second object of one of the new cry classes.

message

A logical variable. If TRUE, the function prints a message on the errors, if any (default is FALSE, i.e. no message printed).

Details

The available checks for individual objects are:

  • angle (unit cell angle)

  • bravais (Bravais system)

  • unit_cell (unit cell)

  • rec_unit_cell (reciprocal unit cell)

  • cryst_symm (crystallographic symmetry)

  • merged_reflections (scaled and merged data)

The available checks for couple of objects are:

  • bravais and unit_cell

  • unit_cell and cryst_symm

Value

ans A logical value. ans = TRUE means that either the parameters of the single object (if only one input is provided) are valid parameters, or that the two objects are compatible with each other.

Examples

# Create a cubic cell with side 50
uc <- create_unit_cell(50)

# Create an object of class "cryst_symm"
crsym <- cryst_symm("P m -3")

# Are they compatible with each other?
check_validity(uc,crsym,TRUE)


cry documentation built on Oct. 10, 2022, 9:06 a.m.