elco_el_symbol: Getting or setting chemical element information

View source: R/elco_el_symbol.R

elco_el_symbolR Documentation

Getting or setting chemical element information

Description

Getting or setting chemical element information

Usage

elco_el_symbol(x)

## S3 method for class 'elco'
elco_el_symbol(x)

elco_el_symbol(x) <- value

## S3 replacement method for class 'elco'
elco_el_symbol(x) <- value

## S3 replacement method for class 'quantities'
elco_el_symbol(x) <- value

elco_set_el_symbol(x, value)

## S3 method for class 'elco'
elco_set_el_symbol(x, value)

## S3 method for class 'quantities'
elco_set_el_symbol(x, value)

Arguments

x

An object.

value

A character value representing a chemical element symbol with which to set or replace an existing attribute "el_symbol" in x.

Value

x converted to an elco object.

x with attribute value for el_symbol replaced by value.

Examples

# getting element information from an `elco` object
elco_el_symbol(elco::chno$C)

## setting element information in an `elco` object
x <- elco::chno$C
elco_el_symbol(x) <- "C"

# pipe-friendly
elco::chno$C %>% elco_set_el_symbol("C")

## setting element information in a `quantities` object
x <- elco_drop_elco(elco::chno$C)

elco_el_symbol(x) <- "C"

# pipe-friendly
x <-
  elco_drop_elco(elco::chno$C) %>%
  elco_set_el_symbol("C")


henningte/elco documentation built on May 21, 2022, 6:56 p.m.