[R] What to do when problems() returns nothing
Rich Shepard
r@hep@rd @end|ng |rom @pp|-eco@y@@com
Wed Nov 3 19:49:50 CET 2021
When I source the import_data.R script now I get errors that tell me to look
at problems(). I enter that function name but there's no return.
Reading ?problems I learned that stop_for_problems(x) should stop the
process when a problem occurs, so I added that function to each data file;
for example,
library(tidyverse)
library(lubridate)
cor_disc <- read_csv("../data/cor-disc.csv", col_names = TRUE,
col_types = list (
site_nbr = col_character(),
year = col_integer(),
mon = col_integer(),
day = col_integer(),
hr = col_double(),
min = col_double(),
cfs = col_integer())
)
stop_for_problems(cor_disc)
running the command, source('input_data.R') produces this result:
> source('import_data.R')
> Error: 415903 parsing failures
> In addition: Warning message:
> One or more parsing issues, see `problems()` for details
When I run the problems() function nothing is returned:
> problems()
>
What do I read to learn how to identify the problems so I can fix them?
TIA,
Rich
More information about the R-help
mailing list