R/utils-misc.R
parse_string.Rd
Parse a string into a number, NA or to remain as a string
parse_string(x)
The character string to parse
One of: a number, NA or the original string
parse_string("NA") #> [1] NA parse_string("notanumber") #> [1] "notanumber" parse_string("100") #> [1] 100 parse_string("0.45") #> [1] 0.45 parse_string("false") #> [1] FALSE