casconv: Function to convert between hypen and hyphen-less CAS...

View source: R/casconv.R

casconvR Documentation

Function to convert between hypen and hyphen-less CAS strings.

Description

Function to convert between hypen and hyphen-less CAS strings.

Usage

casconv(x, hyphen = TRUE, na_999 = FALSE)

Arguments

x

A vector of CAS numbers, either with hyphen (e.g. 50-00-0) or without hyphen (e.g. 50000)

hyphen

Should the hyphen or the hyphen-less CAS string be returned?

na_999

Should NAs be replaced with 999-99-9 or 999999 ?

Examples

vec = c('50-00-0', '1071836', '1071-83-6')
casconv(vec)
casconv(vec, hyphen = FALSE)
casconv(vec, hyphen = FALSE, na_999 = TRUE)

andschar/andmisc documentation built on Jan. 19, 2025, 10:46 a.m.