parse_guess() returns the parser vector; guess_parser() returns the name of the parser. These functions use a number of heuristics to determine which type of vector is "best". Generally they try to err of the side of safety, as it's straightforward to override the parsing choice if needed.

parse_guess(x, na = c("", "NA"), locale = default_locale(),
  trim_ws = TRUE)

col_guess()

guess_parser(x, locale = default_locale())

Arguments

x

Character vector of values to parse.

See also

Other parsers: parse_factor, parse_logical, parse_number

Examples

# Logical vectors parse_guess(c("FALSE", "TRUE", "F", "T"))
#> Error in is.locale(locale): could not find function "is.locale"
# Integers and doubles parse_guess(c("1","2","3"))
#> Error in is.locale(locale): could not find function "is.locale"
parse_guess(c("1.6","2.6","3.4"))
#> Error in is.locale(locale): could not find function "is.locale"
# Numbers containing grouping mark guess_parser("1,234,566")
#> Error in is.locale(locale): could not find function "is.locale"
parse_guess("1,234,566")
#> Error in is.locale(locale): could not find function "is.locale"
# ISO 8601 date times guess_parser(c("2010-10-10"))
#> Error in is.locale(locale): could not find function "is.locale"
parse_guess(c("2010-10-10"))
#> Error in is.locale(locale): could not find function "is.locale"