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

problems

Retrieve parsing problems


Description

Readr functions will only throw an error if parsing fails in an unrecoverable way. However, there are lots of potential problems that you might want to know about - these are stored in the problems attribute of the output, which you can easily access with this function. stop_for_problems() will throw an error if there are any parsing problems: this is useful for automated scripts where you want to throw an error as soon as you encounter a problem.

Usage

problems(x)

stop_for_problems(x)

Arguments

x

An data frame (from read_*()) or a vector (from parse_*()).

Value

A data frame with one row for each problem and four columns:

row,col

Row and column of problem

expected

What readr expected to find

actual

What it actually got

Examples

x <- parse_integer(c("1X", "blah", "3"))
problems(x)

y <- parse_integer(c("1", "2", "3"))
problems(y)

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.