Replies: 1 comment 3 replies
-
Thanks @ethanbass, I like the idea to automatically format everywhere, the impact would be less characters of code to reach the end result and less frustration. Maybe |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It seems that most
webchem
functions do not currently check the formatting of CAS numbers. For example,cts_convert("1333740", from='CAS', to="ChemSpider")
returns NA, but if you reformat the CAS numbercts_convert(webchem::as.cas("1333740"), from='CAS', to="ChemSpider")
the function returns several chemspider IDs. However, some functions (likenist_ri
) internally reformat the CAS number by running it through theas.cas
function.While CAS numbers are normally written with hyphens, it is also fairly common to see CAS numbers "in the wild" written as one long string of numbers without hyphens. I am thinking it would be helpful to throw a warning for improperly formatted CAS numbers and/or automatically run them through
as.cas
to ensure they are formatted correctly, rather than returning NA for CAS numbers that are "improperly" formatted.Beta Was this translation helpful? Give feedback.
All reactions