You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
library(readr)
input<-"x,y\n1,2\n\n"
read.csv(text=input)
#> x y#> 1 1 2
read_csv(input)
#> Warning: 1 parsing failure.#> row col expected actual#> 2 -- 2 columns 1 columns#> Source: local data frame [2 x 2]#> #> x y#> (int) (int)#> 1 1 2#> 2 NA NA
read_csv(trimws(input))
#> Source: local data frame [1 x 2]#> #> x y#> (int) (int)#> 1 1 2
It seems reasonable to tolerate and ignore blank lines ... at least at the end of the input.
The text was updated successfully, but these errors were encountered:
Yeah, I think that's totally reasonable (and for empty lines anywhere, not just at the end). It's just a little tricky to implement because you need to think more about what line numbers to report in error messages etc - the original line numbers, or the row numbers in the generated data frame.
It seems reasonable to tolerate and ignore blank lines ... at least at the end of the input.
The text was updated successfully, but these errors were encountered: