mol: Create a molecule object

Description Usage Arguments Format Value Examples

View source: R/molecule.R

Description

Create a molecule object

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
mol(..., validate = TRUE)

molecule_single(..., charge = 0, count = NA_real_, validate = TRUE)

as_molecule_single(x, ...)

as_mol(x, ...)

as.mol(x, ...)

## S3 method for class 'molecule_single'
as_molecule_single(x, ...)

## S3 method for class 'list'
as_molecule_single(x, validate = TRUE, ...)

## S3 method for class 'mol'
as_molecule_single(x, ...)

## S3 method for class 'character'
as_molecule_single(x, validate = TRUE, ...)

## S3 method for class 'formula'
as_molecule_single(x, validate = TRUE, ...)

## S3 method for class 'mol'
as_mol(x, ...)

## S3 method for class 'molecule_single'
as_mol(x, validate = TRUE, ...)

## S3 method for class 'reaction'
as_mol(x, ...)

## S3 method for class 'character'
as_mol(x, validate = TRUE, ...)

## S3 method for class 'formula'
as_mol(x, validate = TRUE, ...)

## S3 method for class 'list'
as_mol(x, validate = TRUE, ...)

new_mol(x)

NA_molecule_

electron_

## S3 method for class 'molecule_single'
is.na(x)

## S3 method for class 'mol'
is.na(x)

validate_molecule_single(x)

validate_mol(x)

is_molecule_single(x)

is_mol(x)

Arguments

...

A named list of symbols and counts

validate

Validate elements in molecule

charge

The charge of the molecule

count

Optional count to associate with the object

x

An object to be coerced to a mol object

Format

An object of class molecule_single of length 0.

Value

An object of class molecule

Examples

1
2
3
m1 <- molecule_single(H=2, O=1)
m2 <- molecule_single(H=1, charge = 1)
mol(m1, m2)

paleolimbot/chemr documentation built on Sept. 11, 2021, 2:02 p.m.