Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

parse_vector

Parse a character vector.


Description

Parse a character vector.

Usage

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

Arguments

x

Character vector of elements to parse.

collector

Column specification.

na

Character vector of strings to interpret as missing values. Set this option to character() to indicate no missing values.

locale

The locale controls defaults that vary from place to place. The default locale is US-centric (like R), but you can use locale() to create your own locale that controls things like the default time zone, encoding, decimal mark, big mark, and day/month names.

trim_ws

Should leading and trailing whitespace be trimmed from each field before parsing it?

See Also

Examples

x <- c("1", "2", "3", "NA")
parse_vector(x, col_integer())
parse_vector(x, col_double())

readr

Read Rectangular Text Data

v1.4.0
GPL (>= 2) | file LICENSE
Authors
Hadley Wickham [aut], Jim Hester [aut, cre], Romain Francois [ctb], R Core Team [ctb] (Date time code adapted from R), RStudio [cph, fnd], Jukka Jylänki [ctb, cph] (grisu3 implementation), Mikkel Jørgensen [ctb, cph] (grisu3 implementation)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.