webchem (version 1.1.1)

as.cas: Format numbers as CAS numbers

Description

This function attempts to format numeric (or character) vectors as character vectors of CAS numbers. If they cannot be converted to CAS format or don't pass is.cas, NA is returned

Usage

as.cas(x)

Arguments

x

numeric vector, or character vector of CAS numbers missing the hyphens

Value

character vector of valid CAS numbers

See Also

is.cas

Examples

Run this code
# NOT RUN {
x = c(58082, 123456, "hexenol")
as.cas(x)

# }

Run the code above in your browser using DataLab