CAS_test: Test whether CAS number follows valid format

Description Usage Arguments Value Author(s) See Also Examples

View source: R/ChemicalCuration.R

Description

This basic function using string manipulation to test whether a CAS number is in the expected format. Useful to detect errors that occur in excel etc. Potential future extension: to return corrected CAS numbers (not yet implemented). This function checks if the string is longer than 7 and contains 3 dashes.

Usage

1
CAS_test(CAS_RN)

Arguments

CAS_RN

Text string containing the CAS number to test.

Value

Returns TRUE or FALSE (fails test).

Author(s)

Emma Schymanski <emma.schymanski@uni.lu>

See Also

getSuspectIdentifiers.

Examples

1
2
CAS_test("95-14-7")
CAS_test("01.03.7440")

schymane/RChemMass documentation built on Jan. 25, 2021, 5:45 a.m.