chem_expression: Format objects as plotmath expressions

Description Usage Arguments Examples

View source: R/formatting.R

Description

For use on plots using parse = TRUE

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
chem_expression(x, ...)

## Default S3 method:
chem_expression(x, ...)

## S3 method for class 'reaction'
chem_expression(x, equals_sign = NULL, ...)

## S3 method for class 'reaction_list'
chem_expression(x, ...)

Arguments

x

A mol, reaction, or reaction list object

...

Passed to as.character()

equals_sign

An equals sign to use for a reaction object

Examples

1
2
3
chem_expression(as_reaction("2H+ + 2OH- = 2H2O"))
chem_expression(as_reaction_list("2H+ + 2OH- = 2H2O"))
chem_expression(as_mol(c("SO4-2", "Ca+2")))

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